forked from SaurabhDev/Installation-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Important Commands
22 lines (20 loc) · 948 Bytes
/
Important Commands
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#Start/Stop the Tomcat Server
#if (ps -eaf | grep -v grep | grep tomcat | awk '{print $2}'); then
echo 'process is running'
#sudo kill $(ps -eaf | grep -v grep | grep tomcat | awk '{print $2}')
#fi
sudo rm -rf /opt/tomcat/apache-tomcat-9.0.24/webapps/Demo-CICD.war
sudo cp /var/lib/jenkins/workspace/JenkinsDemo/target/Demo-CICD.war /opt/tomcat/apache-tomcat-9.0.24/webapps/
cd /opt/tomcat/apache-tomcat-9.0.24/bin/
sudo ./startup.sh
# Add jenkins to sudo user
usermod -a -G sudo jenkins
#Start/Stop the Tomcat Server
#if (ps -eaf | grep -v grep | grep tomcat | awk '{print $2}'); then
echo 'process is running'
#sudo kill $(ps -eaf | grep -v grep | grep tomcat | awk '{print $2}')
#fi
sudo rm -rf /opt/tomcat/apache-tomcat-9.0.24/webapps/Demo-CICD.war
sudo cp /var/lib/jenkins/workspace/JenkinsDemo/target/Demo-CICD.war /opt/tomcat/apache-tomcat-9.0.24/webapps/
cd /opt/tomcat/apache-tomcat-9.0.24/bin/
sudo ./startup.sh