You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
836 B
27 lines
836 B
|
3 years ago
|
#!/bin/bash
|
||
|
|
log_file=/data/apps/jenkins/shells/deployLog.log
|
||
|
|
#模块名称
|
||
|
|
#sh /data/apps/jenkins/shells/deploy_hly_project.sh $module_name $BUILD_NUMBER $JOB_BASE_NAME $profile $JOB_NAME
|
||
|
|
echo $1 >>$log_file
|
||
|
|
echo $2 >>$log_file
|
||
|
|
echo $4 >>$log_file
|
||
|
|
echo $5 >>$log_file
|
||
|
|
target=$1
|
||
|
|
#环境test pro
|
||
|
|
profile=$4
|
||
|
|
project=${target##*/}
|
||
|
|
deployFile=/data/apps/jenkins/workspace/workspace/$5/$target/target/*.tar.gz
|
||
|
|
|
||
|
|
echo "deployFile:$deployFile profile:$profile project:$project"
|
||
|
|
|
||
|
|
if [ "$profile" == "test" ];then
|
||
|
|
scp $deployFile webadmin@172.29.231.40:/data/deploy/java/
|
||
|
|
ssh webadmin@172.29.231.40 "sh /data/deploy/bin/$profile/restartproject.sh $project"
|
||
|
|
fi
|
||
|
|
|
||
|
|
if [ "$profile" == "pro" ];then
|
||
|
|
scp $deployFile webadmin@116.62.238.73:/data/deploy_files/java
|
||
|
|
|
||
|
|
ssh webadmin@116.62.238.73 "sh /data/deploy_files/bin/copyproject.sh $project"
|
||
|
|
fi
|