So as announced in post: Deploy Rails Project with Capistrano and Git to AWS EC2, i will explain it here, how we can deploy our rails application to EC2 after a successfully build on Jenkins.

After you installed and setup Capistrano described in Post before, lets configure our Jenkins to execute this recipe.

Install Post-Build-Task Plugin

Go to your PluginsSite: http://YourJenkinsServer/pluginManager/? and install the following Plugin: https://wiki.jenkins-ci.org/display/JENKINS/Post+build+task

Setup Post-Build-Task Plugin

Go to your Job setup and create a new Post-build-Action. Select the Post-Build-Task.

Add the command to execute your correct recipe as shown in the image.

 

PostBuildTask

 

Copy your Pem file to your Jenkins .ssh folder

See also: Copy files to AWS EC2 via SSH

Because you have copied it with the user ubuntu, you have to copy it then manually to /var/lib/jenkins/.ssh.

You also have to give the jenkins user permission to execute the PEM file.

 

Deploy Rails Project with Capistrano and Git to AWS EC2 after successfully build on jenkins
Tagged on:             

Leave a Reply

Follow

Get every new post on this blog delivered to your Inbox.

Join other followers:

Welcome Damir Kusar

Log in

Lost your password?
%d bloggers like this: