Balaji Vajjala's Blog

A DevOps Blog from Trenches

06.05

  • 6.5 Configure a scripted deployment job
    • Learning Objectives
    • Create a scripted deployment job in Jenkins

6.5 Configure a scripted deployment job

Learning Objectives

By the end of this lesson you will be able to:

  • Create a Jenkins job that runs a scripted deployment.

Create a scripted deployment job in Jenkins

  1. From the Jenkins dashboard, select the New Job link.
  2. Select the checkbox next to This build is parameterized. Enter a String Parameter type and give it the name STACK_NAME. Enter your student id for the Default Value text field.
  3. Enter MyDeployment in the Job name field. Click on the Build a free-style software project radio button and click the OK button.
  4. Under the Source Code Management section, select the Git radio button. In the Repository URL field, enter your forked repository URL (where student29 is your student id):

    git@github.com:student29/continuous_integration_example.git

  5. In the Branches to build | Branch Specifier field, enter **.

  6. Within the Build section, enter the following command in the Execute shell text field.

    echo ${STACK_NAME} cd software/deployment/ cap deploy:setup ls pwd

  7. Click the Save button.

  8. Go back to the Jenkins dashboard and click the Build button next to the MyDeployment job.