Balaji Vajjala's Blog

A DevOps Blog from Trenches

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

Slide1

Create an S3 bucket to host credentials

  1. 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

  1. 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

    “`

  2. In S3, go to the bucket you created in the 1st lesson (e.g. ditcxyzcreds).

  3. Click on the Upload button.
  4. Click Add Files.
  5. Click Start Upload.

Launch a Jenkins instance using CloudFormation

  1. Click this link to launch a Jenkins CI server instance.
  2. Click Continue.
  3. 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.
  4. Click Continue again, then Close.
  5. Once the status in CloudFormation is CREATE_COMPLETE, select the checkbox next to Jenkins stack.
  6. Select the Outputs tab in the bottom panel and click on the URL for the Jenkins CI server.
  7. Verify the Jenkins dashboard is displayed.

Review and run a Jenkins CI job

  1. From the Jenkins dashboard, click on the job labeled Build.
  2. Click the Build Now link.
  3. Select the top link in the Build History section, then select the Console Output link and watch the job running in real time.