Alibaba Cloud Toolkit Command Writing Guide

This article provides the best practice for writing commands when you are using the Alibaba Cloud Toolkit plug-in to deploy the following applications:

  • Standard Java Web Tomcat applications
  • Standard Java Fatjar applications
  • Standard Spring Boot applications
  • Standard Go applications

Standard Java Web Tomcat 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:

The content of the restart-tomcat.sh script is as follows:

The /ect/profile file is used to configure environment variables, and contains content similar to the following:

Standard Java Fatjar Applications

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:

The content of the restart-java.sh script is as follows:

Standard Spring Boot Applications

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:

The content of the restart-springboot.sh script is as follows:

Standard Go Applications

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:

The content of the restart-go.sh script is as follows:

Original Source

https://www.alibabacloud.com/blog/alibaba-cloud-toolkit-command-writing-guide_594999?spm=a2c41.13111833.0.0

Written by

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store