tocken
Generate tocken
여기에 받은 토큰값 넣어줌
cd /var/lib/jenkins/workspace/
-> 얘는 test-dev 레포 써줌
# cd /opt
# wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
# tar -xvzf apache-maven-3.8.8-bin.tar.gz
# mv apache-maven-3.8.8 maven
# ls maven/bin
# cd ~
# find / -name java-11*
# vi .bash_profile
M2_HOME=/opt/maven
M2=/opt/maven/bin
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.amzn2.0.1.x86_64
# User specific environment and startup programs
--- Tomcat 서버 설치 https://tomcat.apache.org/download-90.cgi
$ sudo su -
# timedatectl set-timezone Asia/Seoul
# yum update -y
# hostnamectl set-hostname tomcat-server
# amazon-linux-extras install -y java-openjdk11
# cd /opt
# wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.76/bin/apache-tomcat-9.0.76.tar.gz
# tar -xvzf apache-tomcat-9.0.76.tar.gz
# mv apache-tomcat-9.0.76 tomcat
# cd tomcat/bin/
# ./startup.sh
# cd /opt/tomcat
# find / -name context.xml
# vi /opt/tomcat/webapps/host-manager/META-INF/context.xml
<!-- <Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> -->
# vi /opt/tomcat/webapps/manager/META-INF/context.xml
<!-- <Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> -->
# cd bin/
# ./shutdown.sh
# ./startup.sh
# vi /opt/tomcat/conf/tomcat-users.xml
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="admin" password="kosa0220" roles="manager-gui, manager-script, manager-jmx, manager-status"/>
<user username="deployer" password="kosa0220" roles="manager-script"/>
<user username="tomcat" password="kosa0220" roles="manager-gui"/>
# ln -s /opt/tomcat/bin/startup.sh /usr/local/bin/tomcatup
# ln -s /opt/tomcat/bin/shutdown.sh /usr/local/bin/tomcatdown
# tomcatdown
# tomcatup
admin으로 tomecat manager들어가보기
git checkout master
다시
vi index.jsp
하면 좀 다르게 뜸
scm
젠킨스가 1분마다 한번씩 확인해서 변경되면 자동으로 빌드함
빌드 안눌렀는데 자동으로 됨
바뀐거 확인가능
two-rabbit.jpg랑 index.html 추가하고 푸시 ㄱㄱ
커밋을하니 자동으로 빌드가 되고
바뀐 webapp이 배포된거 확인가능