04
- 4.5 Configure a scripted deployment job
- Learning Objectives
- Create a scripted deployment job in Jenkins
4.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
- From the Jenkins dashboard, select the New Job link.
- Enter MyDeployment in the Job name field. Click on the Build a free-style software project radio button and click the OK button.
Under the Source Code Management section, select the Git radio button. In the Repository URL field, enter your forked repository URL. Mine is git@github.com:stelligent/devopsinthecloud.git. Yours will be something like:
git@github.com:YourUsername/devopsinthecloud.git
In the Branches to build | Branch Specifier field, enter master.
Within the Build section, enter the following command in the Execute shell text field.
instance_ip=`ruby /usr/share/tomcat6/sqs_receive_message.rb Deployment $AWS_ACCESS_KEY $AWS_SECRET_ACCESS_KEY` echo $instance_ip cd $WORKSPACE/deployment/ cap deploy:deploy
Click the Save button.
- Go back to the Jenkins dashboard and click the Build button next to the MyDeployment job.