[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: External Jenkins Integeration With OpenShift

Hey Shabna, is your primary goal to just be able to deploy built artifacts from an external Jenkins to OpenShift?  If so, I would recommend the following steps to understand how this is done within OpenShift.  First, spin up an application on OpenShift and add Enable Jenkins builds for that application in the console.  This in turn will create a Jenkins master and configure the job.  Next, look at the job configuration (you will get a URL as a result of enabling Jenkins).  You will see both a building step (e.g. gear build) and then you will see a step that copies the built artifact to the end destination (using rsync).  In your case, you don't need to worry about the build since you are running that yourself.  You just need to focus on the deploy steps.  When I create a PHP application with Jenkins, I get the following Jenkins job configuration:
upstream_ssh="51b1db7de0b8cdd11f000093 phpdemo-${OPENSHIFT_NAMESPACE} rhcloud com"

# Stop app
$GIT_SSH $upstream_ssh 'gear stop --conditional'

# Push content back to application
rsync ${OPENSHIFT_PHP_DIR}phplib/ $upstream_ssh:'${OPENSHIFT_PHP_DIR}phplib/'
rsync $WORKSPACE/ $upstream_ssh:'${OPENSHIFT_REPO_DIR}'

# Configure / start app
$GIT_SSH $upstream_ssh 'gear remotedeploy'

You should be able to run these same steps from your external Jenkins machine as long as it has the private SSH key for your application.  This will let you deploy, stop, start, etc your application as needed from a separate machine.  If you want to see the exact commands (e.g. to see what $GIT_SSH resolves to), you can add some debug commands to your build configuration and then run it.  For example, when I add the following line to my job:
echo $GIT_SSH
I get the resulting output in the Jenkins build log:
+ echo /usr/libexec/openshift/cartridges/v2/jenkins/bin/git_ssh_wrapper.sh
A quick 'find ./ -name "git_ssh_wrapper.sh' on the origin-server project codebase then leads you to:
Anyway, hope this helps and gives you enough information to accomplish what you need.


On 06/07/2013 05:51 AM, s madathilthattantav accenture com wrote:

Hi All


I have the following scenario :Need to integrate External Jenkins [ex: hosted on aws ] to deploy war files in OpenShift Enterprise.


Background :We are in the process of doing some research on what is best suited with our current infrastructure ,hence exploring option other than Jenkins Integration that Openshift provides.


I saw the forum thread https://www.openshift.com/forums/openshift/public-jenkins-plugin-for-deploying-apps-to-openshift


And  tried the suggested solution ,but  the folder structure mentioned is not present in my application gear, and I am little confused as well

On the steps involved.Any pointers  on how to achieve this will be highly appreciated, since it’s an urgent requirement .





This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited.

Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.



dev mailing list
dev lists openshift redhat com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]