ci: 서버배포 스크립트 추가

dev
Jonguk. Lim 4 months ago
parent 8f620d6660
commit adb7bab632

@ -0,0 +1,43 @@
# 베포 스크립트 가이드
> /application/adds/tomcat에 배포 스크립트를 추가
### 0. war 파일 upload
> /application/adds 에 adds-fo.war 파일을 업로드
### 1. application deploy
> /application/adds/tomcat/webapps/ROOT.war_backup 삭제
> /application/adds/adds-fo.war -> /application/adds/tomcat/webapps/ROOT.war로 이동
> tomcat shutdown
> /application/adds/tomcat/webapps/ROOT 폴더 삭제
```shell
$ /application/adds/tomcat/deploy.sh
```
### 2. application start
```shell
$ /application/adds/tomcat/start.sh
```
### 3. stop
```shell
$ /application/adds/tomcat/stop.sh
```
### shell script 실행시 에러 조치
> then ^M .... 에러 발생시
> window에서 작성된 shell script를 linux에서 실행시 발생하는 에러
> \r문자가 포함되어 있어서 발생하는 에러
```shell
$ dos2unix 파일명.sh
# dos2unix 설치
$ sudo yum install dos2unix
```

@ -0,0 +1,8 @@
rm -f /applications/adds/tomcat/webapps/ROOT.war_backup
mv /applications/adds/tomcat/webapps/ROOT.war /applications/adds/tomcat/webapps/ROOT.war_backup
cp /applications/adds/adds-fo.war /applications/adds/tomcat/webapps/ROOT.war
#cp /var/lib/jenkins/workspace/ENS-WEB/build/libs/ROOT.war /applications/ENS-WEB/tomcat/webapps
source /applications/adds/tomcat/tomcat.sh
/usr/local/lib/apache-tomcat-9.0.56/bin/shutdown.sh
rm -rf /applications/adds/tomcat/webapps/ROOT
#/usr/local/lib/apache-tomcat-8.5.73/bin/startup.sh

@ -0,0 +1,2 @@
source /applications/adds/tomcat/tomcat.sh
/usr/local/lib/apache-tomcat-9.0.56/bin/startup.sh $1 $2

@ -0,0 +1,2 @@
source /applications/adds/tomcat/tomcat.sh
/usr/local/lib/apache-tomcat-9.0.56/bin/shutdown.sh

@ -0,0 +1,9 @@
export JAVA_HOME=/lib/jvm/jdk-17.0.2
export CATALINA_HOME=/usr/local/lib/apache-tomcat-9.0.56
export CATALINA_BASE=/applications/adds/tomcat
export CATALINA_TMPDIR=/applications/adds/tomcat/temp
export CATALINA_OUT=/data/adds/logs/adds-fo-tomcat.log
export CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$CATALINA_HOME/lib/jsp-api.jar:$CATALINA_HOME/lib/servlet-api.jar
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:$CATALINA_HOME/bin
# conf/catalina.properties에서 설정
#export JAVA_OPTS="-Dspring.profiles.active=dev"
Loading…
Cancel
Save