Balaji Vajjala's Blog

A DevOps Blog from Trenches

06.10

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

6.10 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

Delivery Pipeline

Slide1

EXERCISE: Create and link Jenkins jobs

  1. Create the following jobs in Jenkins: CreateEnvironment, Commit, UnitTest, CreateDatabase, Deploy, AcceptanceTest, LoadTest and Production. You won’t be entering any configuration for the jobs, but you will consider the different types of scripts that might be executed for each of the stages in the delivery pipeline (See below).
  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: brewery_production.template, target.feature 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-database-mysql.sql, create-tables-mysql.sql, etc.
  8. View the different scripts that you might execute when running the AcceptanceTest stage: target.feature.

EXERCISE: 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 CreateEnvironment. This pipeline calls the CreateEnvironment 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.