首页 > 代码库 > jenkens构建脚本
jenkens构建脚本
Build | |||
Root POM | |||
Goals and options | |||
Command | # consts SERVER="192.168.60.209" DEPLOY="ROOT" SERIVCE="ddcms" OUT_TGT="target/ddcms.war" RELEASE_DIR="${WORKSPACE}/.release" SSH_OPTS="-i ${JENKINS_HOME}/.ssh/id_rsa -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" # uncompress jetty war [ -d "${RELEASE_DIR}" ] && rm -rf "${RELEASE_DIR}" /bin/mkdir "${RELEASE_DIR}" 2>/dev/null /usr/bin/unzip ${WORKSPACE}/${OUT_TGT} -d "${RELEASE_DIR}" /usr/bin/git rev-parse HEAD > "${RELEASE_DIR}/.revision" # purge code via ssh /usr/bin/ssh ${SSH_OPTS} \ root@${SERVER} "rm -rf /opt/phoenix/deploy/${SERIVCE}/webapps/${DEPLOY}/WEB-INF/classes" /usr/bin/ssh ${SSH_OPTS} \ root@${SERVER} "rm -rf /opt/phoenix/deploy/${SERIVCE}/webapps/${DEPLOY}/WEB-INF/lib" /usr/bin/ssh ${SSH_OPTS} \ root@${SERVER} "rm -rf /opt/phoenix/deploy/${SERIVCE}/webapps/${DEPLOY}/WEB-INF/web.xml" # push git revision tag via ssh /usr/bin/scp ${SSH_OPTS} \ ${RELEASE_DIR}/.revision root@${SERVER}:"/opt/phoenix/deploy/${SERIVCE}/webapps/${DEPLOY}" # push code via scp /usr/bin/scp -r ${SSH_OPTS} \ ${RELEASE_DIR}/WEB-INF/classes root@${SERVER}:"/opt/phoenix/deploy/${SERIVCE}/webapps/${DEPLOY}/WEB-INF/" /usr/bin/scp -r ${SSH_OPTS} \ ${RELEASE_DIR}/WEB-INF/lib root@${SERVER}:"/opt/phoenix/deploy/${SERIVCE}/webapps/${DEPLOY}/WEB-INF/" /usr/bin/scp -r ${SSH_OPTS} \ ${RELEASE_DIR}/WEB-INF/web.xml root@${SERVER}:"/opt/phoenix/deploy/${SERIVCE}/webapps/${DEPLOY}/WEB-INF/" # restart the service /usr/bin/ssh ${SSH_OPTS} root@${SERVER} "/sbin/service ${SERIVCE} restart" | ||
jenkens构建脚本
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。