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
Create and link Jenkins jobs
- Create the following jobs in Jenkins: CreateEnvironment, Commit, UnitTest, CreateDatabase, Deploy, FunctionalTest, LoadTest and Production.
- Click Configure for each job configure the job to trigger the next job only if the current job succeeds.
- 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.
- View the different scripts that you might execute when running the Commit stage: Rake and S3.
- View the different scripts that you might execute when running the UnitTest stage: Unit Tests.
- View the different scripts that you might execute when running the Deploy stage: deploy.rb and deployment.feature.
- View the different scripts that you might execute when running the CreateDatabase stage: create_users.rb, add_email_uniqueness_index.rb, etc.
- View the different scripts that you might execute when running the FunctionalTest stage: users_spec.rb.
Create a delivery pipeline in Jenkins
- Add a new view.
- Click on the link labeled View/Hide Build Pipeline Icon Legend and view the description.
- Click on the link labeled Configure View.
- 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.