LINUX/Jenkins

[Jenkins] *.properties_TB > *.properties 로 변경

민덕이 2019. 11. 9. 12:06
반응형

필자는 local용 properties, TB용 properties, PROD용 properties를 따로 쓴다.

Jenkins로 TB를 올릴 때 properties를 변경하는 법을 쓴다.

간단하지만 나중에 필자가 재사용 하기위해 쓰는 포스팅이다.

 

 

Jenkins Execute shell에서 scp /home/alsdud154/src/binder/WEB-INF/classes/properties/binder.properties_TB alsdud154@192.168.0.15:/home/alsdud154/src/binder/WEB-INF/classes/properties/binder.properties를 추가해준다.

WORKSPACE="/var/lib/jenkins/workspace"
TOMCAT="/usr/local/apache-tomcat-8.5.47-binder"
SVR="192.168.0.15"
ssh alsdud154@$SVR $TOMCAT/bin/shutdown.sh
ssh alsdud154@$SVR "rm -rf /home/alsdud154/src/binder/*"
scp $WORKSPACE/binder/target/*.war alsdud154@$SVR:/home/alsdud154/src/binder/BinderApiWeb.war
ssh alsdud154@$SVR "cd /home/alsdud154/src/binder; /usr/lib/jvm/java-8-openjdk-amd64/bin/jar -xvf BinderApiWeb.war"

scp /home/alsdud154/src/binder/WEB-INF/classes/properties/binder.properties_TB alsdud154@192.168.0.15:/home/alsdud154/src/binder/WEB-INF/classes/properties/binder.properties

ssh alsdud154@$SVR $TOMCAT/bin/startup.sh

 

반응형