01
- 1.8 Run Jenkins Continuous Integration server jobs
- Learning Objectives
- Continuous Integration
- Create an S3 bucket to host credentials
- Upload SSH keys
- Launch a Jenkins instance using CloudFormation
- Review and run a Jenkins CI job
1.8 Run Jenkins Continuous Integration server jobs
Learning Objectives
By the end of this lesson you will be able to:
- Run jobs on the Jenkins CI server.
Continuous Integration
Create an S3 bucket to host credentials
- Create a new S3 bucket and call it ditcxyzcreds – where xyz are your initials. Write down both of these S3 buckets (ditcxyzcreds and ditcxyzartifacts) as you will use them several times throughout this LiveLesson.
Upload SSH keys
Secure Copy the SSH key files to your computer. The example below assumes you’re using a *nix computer. If you’re using Windows, use Putty. Your Public DNS will be different.
“` scp -i ditc.pem ec2-user@ec2-23-22-4-199.compute-1.amazonaws.com:~/.ssh/id_rsa ~/Desktop scp -i ditc.pem ec2-user@ec2-23-22-4-199.compute-1.amazonaws.com:~/.ssh/id_rsa.pub ~/Desktop scp -i ditc.pem ec2-user@ec2-23-22-4-199.compute-1.amazonaws.com:~/.ssh/known_hosts ~/Desktop
“`
In S3, go to the bucket you created in the 1st lesson (e.g. ditcxyzcreds).
- Click on the Upload button.
- Click Add Files.
- Click Start Upload.
Launch a Jenkins instance using CloudFormation
- Click this link to launch a Jenkins CI server instance.
- Click Continue.
- Enter a Key Pair name in the KeyName field. If you want to find your key pairs, click this link. If you followed the instructions in previous exercises, your key will be ditc. Select the checkbox next to I acknowledge that this template may create IAM resources and click Continue.
- Click Continue again, then Close.
- Once the status in CloudFormation is CREATE_COMPLETE, select the checkbox next to Jenkins stack.
- Select the Outputs tab in the bottom panel and click on the URL for the Jenkins CI server.
- Verify the Jenkins dashboard is displayed.
Review and run a Jenkins CI job
- From the Jenkins dashboard, click on the job labeled Build.
- Click the Build Now link.
- Select the top link in the Build History section, then select the Console Output link and watch the job running in real time.