系统配置->SSH Servers 配置:
jenkins配置ssh server
部署脚本
project_name=$1
echo $1
#备份当前jar,随便取一个应用下的common.jar
cd /home/workspace/common/lib/
echo $(pwd)
v_bak_version=`date +%Y-%m-%d-%H%M%S`
echo '版本备份号:' ${v_bak_version}
#
project_bak_path=/home/workspace/jar-bak/${project_name}
cp ${project_name}-1.0.0-SNAPSHOT.jar ${project_bak_path}/${project_name}-1.0.0-SNAPSHOT_${v_bak_version}.jar
#v_bak_version= 'date +%Y%m%d`
echo '