java - OpenShift: Not able to deploy war generated by Jenkins in Openshift to container (Tomcat) in another gear -
first of all, let me inform issue related openshift. i'm tired of building war jenkins , manually transferring newly built war file server - it's time consuming.
i'm trying deploy maven application built jenkins in 1 gear , deploy in tomcat 7 server running in gear.
i'm using deploy container plugin via jenkins push war file tomcat server after being built jenkins. in tomcat server, edited tomcat-users.xml.
<role rolename="manager"/> <role rolename="admin"/> <user username="admin" password="admin" roles="manager"/>
i tried deploy jboss 7 available. not deploy either - decided switch tomcat hope deployment in tomcat easier in jboss.
here how can jenkins/execute shell: (this example java/maven can use other stack.)
source $openshift_cartridge_sdk_bash ## aliasing rsynch alias rsync="rsync --delete-after -az -e '$git_ssh'" ## openshift_namespace => redrumapi ## setting upstream ssh upstream_ssh="${openshift_app_uuid}@apiserver1-${openshift_namespace}.rhcloud.com" ## remove previous metadata, if rm -f $openshift_homedir/app-deployments/current/metadata.json #if ! marker_present "force_clean_build"; # don't fail if these rsyncs fail #set +e rsync $upstream_ssh:'$openshift_build_dependencies_dir' $openshift_build_dependencies_dir rsync $upstream_ssh:'$openshift_dependencies_dir' $openshift_dependencies_dir #set -e #fi ## build/update libs , run user pre_build , build ##gear build cd $openshift_data_dir echo -e "<settings><localrepository>$openshift_data_dir.m2</localrepository></settings>" > settings.xml cd $workspace git pull origin master ## build project settings.xml , other switches might need (or not?) mvn clean install -s $openshift_data_dir/settings.xml -p openshift -djacoco.skip=true -dskiptests -dbuild.number=${build_number} deployment_dir=`$git_ssh $upstream_ssh 'gear create-deployment-dir'` rsync $workspace/redrum-web/target/your_project.war $upstream_ssh:app-root/runtime/repo/webapps $git_ssh $upstream_ssh "gear remotedeploy --trace --deployment-datetime $deployment_dir"
Comments
Post a Comment