Balaji Vajjala's Blog

A DevOps Blog from Trenches

10

  • 10.1 Configure and run a deployment pipeline in Jenkins
    • Learning Objectives
    • Delivery Pipeline
    • Create and link Jenkins jobs
    • Create a delivery pipeline in Jenkins

10.1 Configure and run a deployment pipeline in Jenkins

Learning Objectives

By the end of this lesson you will be able to:

  • Create a delivery pipeline with dependent jobs.

Delivery Pipeline

Slide1

Create and link Jenkins jobs

  1. Create the following jobs in Jenkins: CreateEnvironment, Commit, UnitTest, CreateDatabase, Deploy, FunctionalTest, LoadTest and Production.
  2. Click Configure for each job configure the job to trigger the next job only if the current job succeeds.
  3. View the different scripts that you might execute when running the CreateEnvironment stage: target.template, create_config_domain.rb, sqs_send_message.rb, target.feature, SQS queues and the Jenkins CloudFormation plugin.
  4. View the different scripts that you might execute when running the Commit stage: Rake and S3.
  5. View the different scripts that you might execute when running the UnitTest stage: Unit Tests.
  6. View the different scripts that you might execute when running the Deploy stage: deploy.rb and deployment.feature.
  7. View the different scripts that you might execute when running the CreateDatabase stage: create_users.rb, add_email_uniqueness_index.rb, etc.
  8. View the different scripts that you might execute when running the FunctionalTest stage: users_spec.rb.

Create a delivery pipeline in Jenkins

  1. Add a new view.
  2. Click on the link labeled View/Hide Build Pipeline Icon Legend and view the description.
  3. Click on the link labeled Configure View.
  4. Click on the link labeled Start Build of Pipeline for TargetEnvironment. It will take approximately 20 minutes to run through the pipeline. This pipeline calls the TargetEnvironment job. After the TargetEnvironment is successful, it runs the Deployment. The Deployment job gets deployment artifacts from an Amazon S3 bucket. The Build job – which runs on a “continuous” basis, pushes the zip file to S3 so that it can be used by the Deployment job.