This article provides the best practice for writing commands when you are using the Alibaba Cloud Toolkit plug-in to deploy the following applications:
As shown in the preceding figure, assume that the /root/tomcat/
in the Linux system is the root directory of a Tomcat application. We need to deploy the WAR package (javademo.war) of the Java Web application to the /root/tomcat/webapps
directory.
The corresponding command configuration is as follows:
sh /root/sh/restart-tomcat.sh
The content of the restart-tomcat.sh script is as follows:
source /etc/profile
killall java
rm -rf /root/tomcat/webapps/javademo
sh /root/tomcat/bin/startup.sh
The /ect/profile file is used to configure environment variables, and contains content similar to the following:
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
export JAVA_HOME=/usr/share/jdk1.8.0_14
export PATH=$JAVA_HOME/bin:.....
Assume that the /root/javademo
directory in the Linux system is used as the root directory of a Java application. We need to deploy the jar package of the Java application to the /root/javademo
directory.
The corresponding command configuration is as follows:
sh /root/sh/restart-java.sh
The content of the restart-java.sh script is as follows:
source /etc/profile
killall java
nohup java -jar /root/javademo/javademo-0.0.1-SNAPSHOT.jar > nohup.log 2>&1 &
Assume that the/root/springbootdemo
directory of the Linux system is used as the root directory of a Spring Boot application. We need to deploy the jar package (springbootdemo-0.0.1-SNAPSHOT.jar) of the Spring Boot application to the /root/springbootdemo
directory.
The corresponding command configuration is as follows:
sh /root/sh/restart-springboot.sh
The content of the restart-springboot.sh script is as follows:
source /etc/profile
killall java
nohup java -jar /root/springbootdemo/springbootdemo-0.0.1-SNAPSHOT.jar > nohup.log 2>&1 &
Assume that the /root/godemo
directory in the Linux system is used as the root directory of a Go application. We need to deploy the executable file (godemo) of the Go application to the /root/godemo
directory.
The corresponding command configuration is as follows:
sh /root/sh/restart-go.sh
The content of the restart-go.sh script is as follows:
source /etc/profile
pkill -f 'godemo'
chmod 755 /root/godemo/godemo;
sh -c /root/godemo/godemo
Deploying Applications to EDAS with Cloud Toolkit Maven Plug-in
Deploy Spring Boot or Spring Cloud Applications to Alibaba Cloud in Eclipse
Alibaba Cloud Community - April 15, 2024
Alibaba Clouder - November 23, 2020
Marketplace - November 23, 2018
Aliware - May 20, 2019
Alibaba Clouder - January 28, 2019
Alibaba Clouder - September 7, 2020
Robotic Process Automation (RPA) allows you to automate repetitive tasks and integrate business rules and decisions into processes.
Learn MoreA PaaS platform for a variety of application deployment options and microservices solutions to help you monitor, diagnose, operate and maintain your applications
Learn MoreGain an industrial edge with Alibaba Cloud best practices
Learn MoreAlibaba Cloud (in partnership with Whale Cloud) helps telcos build an all-in-one telecommunication and digital lifestyle platform based on DingTalk.
Learn MoreMore Posts by Nick(倪超)