GithubHelp home page GithubHelp logo

clif2 / jenkins-pipeline-immut Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brian-provenzano/jenkins-pipeline-immut

0.0 2.0 0.0 221 KB

Simple Jenkins pipeline (lab) - immutable arch with packer, ansible, terraform, aws

HTML 0.08% Shell 9.88% HCL 87.06% Python 2.98%

jenkins-pipeline-immut's Introduction

Test Pipeline

Jenkins Declarative Pipeline Example (with packer, terraform, aws, ansible)

NOTE: This can be used with my custom Jenkins containers : jenkins docker alpine and jenkins docker debian

Details

Contains simple Jenkins pipeline that does the following:

  • Create a custom AWS AMI using Packer; Ansible provisioner to config the image as simple apache static site
  • Terraform creates the infra on AWS (choose either single webserver OR ASG/ELG setup)
  • Options to tear down TF infra and Packer AMI when done to avoid charges and stay in the good blessings of the AWS free tier

Setup

To get started do the following (this isn't step by step so it assumes some very basic Jenkins knowledge):

  1. Create a new declarative pipeline in jenkins
  2. Clone the repo https://github.com/brian-provenzano/jenkins-pipeline-immut locally on your dev env, create your own repo in github, git init, add, commit, push origin to your repo to get setup. Setup your access using keys as needed.
  3. Add Credentials parameter that contains your AWS access and secret keys. Use the "usernamne/password" option.

credentials alt

  1. Setup the job to pull the repo for the Jenkinsfile (pipeline). Add your keys as needed (from Step 2)

git Jenkinsfile alt

  1. You should end up with something that looks like this when you view the job (after the initial run/pull).

job Build parameters alt

Pipeline Job parameters / options:

  • Cleanup TF infra when done (boolean) *
  • Cleanup custom AMI when done (boolean) *
  • Use jenkins credentials store for AWS credentials
  • Deploy as ASG/ELB or simple web server instance; default is false for simple web instance (boolean)
  • How long to sleep job after TF creates infra so we can test/view what was done. *

NOTE: *These steps mainly there since this is a lab/test to make sure costs are low and/or stay in free tier.

TODO

  • packer build AMI in AWS with code baked (build etc); currently only configures a static instance of Apache
  • seperate out the terraform, ansible, packer Iaac/config into seperate repos and pull those directly as part of pipeline instead of packing into one repo. Currently setup this way for easy startup / testing...
  • extend ansible configs to install real systems, maybe use RDS (via TF) etc.

jenkins-pipeline-immut's People

Contributors

brian-provenzano avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.