标签:name resolve 描述 clean origin gif 自由风格 span close
1)增加构建步骤,选择 执行shell
#!/bin/sh source /etc/profile SHELLPATH="/data/shell/" SALTPATH="/app/salt/base/init/" JENKINS_FILE="/app/salt/base/jenkins/files/" WORKSPACE="/data/data/jenkins/.jenkins/workspace/" PRO_NAME=$1 REMOTE_IP=$2 TARGET=`ls ${WORKSPACE} | grep ${PRO_NAME} | grep -v ‘@tmp‘ | grep TEST` PACKAGE_NAME=`/usr/bin/ls ${WORKSPACE}${TARGET}/target/ | grep ‘jar‘ | grep -v ‘original‘` /usr/bin/cp ${WORKSPACE}${TARGET}/target/${PACKAGE_NAME} ${JENKINS_FILE} /usr/bin/cp ${SHELLPATH}salt_template.sls ${SHELLPATH}${PRO_NAME}.sls /usr/bin/sed -i "s/PRO_NAME/${PRO_NAME}/g" ${SHELLPATH}${PRO_NAME}.sls /usr/bin/sed -i "s/PACKAGE_NAME/${PACKAGE_NAME}/g" ${SHELLPATH}${PRO_NAME}.sls /usr/bin/cp ${SHELLPATH}${PRO_NAME}.sls ${SALTPATH} /usr/bin/salt ${REMOTE_IP} cmd.run "pkill -f ${PRO_NAME}" /usr/bin/salt ${REMOTE_IP} state.sls init.${PRO_NAME} /usr/bin/salt ${REMOTE_IP} cmd.run "echo ‘source /etc/profile && nohup java -jar ${PACKAGE_NAME} > /dev/null 2>&1 &‘ > /app/java/${PRO_NAME}.sh" /usr/bin/salt ${REMOTE_IP} cmd.run "cd /app/java && nohup /usr/bin/sh ${PRO_NAME}.sh > /dev/null 2>&1 &"
标签:name resolve 描述 clean origin gif 自由风格 span close
原文地址:https://www.cnblogs.com/hd-test/p/11302291.html