Using CodePipeline with Jenkins for Automated DevOps - Exam DOP-C01 Answer

CodePipeline and Jenkins Integration - DevOps Exam Question Answer

Prev Question Next Question

Question

An IT consulting company starts to use CodePipeline to help manage its development lifecycle since AWS CodePipeline is a great DevOps service.

They hope that starting from CodeCommit, the pipeline is able to build the code, test the artifact and deploy the build automatically.

They heard that CodePipeline is also very convenient to work together with Jenkins so they decided to use Jenkins as a build provider.

Another reason is that they already have very strong experiences on Jenkins for their on-premise applications.

Which of the following options is correct on how to use the CodePipeline together with Jenkins?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer -D.

Option D is Correct:

At the moment, CodeBuild, Jenkins and Solano CI can be used as a build provider in the CodePipeline.

During the setup of CodePipeline, the user needs to configure the build provider at the “Build Stage” and select Jenkins as below:

After “Add Jenkins” is selected, in Provider name, type the name of the action you provided in the AWS CodePipeline Plugin for Jenkins (for exampleMyJenkinsProviderName)

This name must exactly match the name in the AWS CodePipeline Plugin for Jenkins.

In Server URL, type the URL of the Amazon EC2 instance where Jenkins is installed.

In Project name, type the name of the project you created in Jenkins, such as MyDemoProject, and then choose Next.

About the details on how to setup CodePipeline with Jenkins, refer to https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-four-stage-pipeline.html.

Option A is incorrect: because all of the AWS resources for the CodePipeline should be in.

the same AWS Region where the CodePipeline is created.

For example, if you create your pipeline in the US East (Ohio) Region, your Amazon S3 bucket or AWS CodeCommit repository, AWS CodeDeploy resources, and Amazon EC2 instance key pair must also be in the US East (Ohio) Region.

Also, refer to.

https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-four-stage-pipeline.html

Option B is incorrect: because the stages of “Jenkins Stage” and “Test Stage” are incorrect.

Also the stages are not mandatory and can be optionally skipped.

The stages should be “Source Stage”, “Build Stage” and “Deploy Stage”.

Option C is incorrect: because it should not use Secret Access Key/Access Key ID for the Jenkins EC2 instance.

The IAM should be used instead.

Besides, both “Provider name” and “Server URL” should match those in the Jenkins server.

Step 1

Choose pipeline settings

Step 2

Add source stage

Step 3
Add build stage

Step 4

Add deploy stage

Step 5

Review

Developer Tools > CodePipeline > Create new pipeline

Add build stage

Build

Build provider

This is the tool of your build project. Provide build artifact details like operating system, build spec file, and output file names,

v

a

AWS CodeBuild
Add Jenkins

Solano Cl

b |

Skip

Option B is the correct answer for using CodePipeline with Jenkins.

Explanation: CodePipeline is a fully managed continuous delivery service that helps you automate your release pipelines for fast and reliable application and infrastructure updates. Jenkins is an open-source automation server that helps to automate parts of the software development process. CodePipeline can work together with Jenkins to build, test, and deploy applications.

Option A is not the correct answer because creating CodeCommit and Amazon EC2 instance key pair in a different region from the CodePipeline is not necessary for safety concerns. This option also does not provide any explanation for the other stages of the pipeline besides the build stage.

Option C is not the correct answer because using Secret Access Key/Access Key ID to grant the instance required permissions for interacting with AWS CodePipeline is not a recommended approach. IAM roles should be used instead to grant the instance required permissions. This option also does not mention the other stages of the pipeline besides the build stage.

Option D mentions launching an Amazon EC2 instance to host the Jenkins server and using an IAM role to grant the instance the required permissions for interacting with AWS CodePipeline, which is the correct approach. This option also mentions configuring the "Provider name" and "Server URL" for the Jenkins build server in the build stage of the pipeline. However, this option does not mention the other stages of the pipeline besides the build stage.

Option B is the correct answer because it mentions creating all the necessary AWS resources in the same AWS Region where the pipeline is created. It also mentions creating a CodePipeline with 4 mandatory stages - "Source Stage", "Jenkins Stage", "Test Stage" and "Deploy Stage". This option provides a complete and accurate solution for integrating CodePipeline with Jenkins.