一、
下载Git Parameter插件:
二、
项目配置:
Shell脚本:
#!/bin/bash -l echo $deploy_env
case $deploy_env in
deploy)
echo "deploy: $deploy_env"
;;
rollback)
echo "rollback: $deploy_env"
cp -R ${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${version}/archive/. ${JENKINS_HOME}/workspace/${JOB_NAME}
;;
*)
exit
;;
esac
三、
打包: