To deploy applications in Serverless App Engine (SAE), you can use the SAE console or the Alibaba Cloud Toolkit for Eclipse plug-in. This topic describes how to use the Alibaba Cloud Toolkit for Eclipse plug-in to deploy an application.
Prerequisites
- Java Development Kit (JDK) 1.8 or later is downloaded and installed.
- Eclipse IDE 4.5.0 (code: Mars) or later is downloaded and installed.
Background information
Alibaba Cloud Toolkit is a free integrated development environment (IDE) plug-in provided by Alibaba Cloud. You can create an Alibaba Cloud account or use an existing Alibaba Cloud account to download and install Alibaba Cloud Toolkit in IntelliJ IDEA for free.
After you develop, debug, and test your application in your data center, you can use the Alibaba Cloud Toolkit plug-in to deploy the application in SAE.
Install Alibaba Cloud Toolkit
- Start Eclipse.
- In the top navigation bar, choose .
- In the Available Software dialog box, enter the following Alibaba Cloud Toolkit for Eclipse URL in the Work with field: http://toolkit.aliyun.com/eclipse/. Then, press the Enter key.
- Configure components.
- In the type filter text list, select the required components.
- In the Details section, clear Contact all update sites during install to find required software.
- Click Next.
- Perform the subsequent steps as prompted on the installation page of Eclipse. Important If a message indicating that no digital signature exists appears, select Install anyway.
- Restart Eclipse.
After you install the Alibaba Cloud Toolkit plug-in, restart Eclipse. Then, you can view that the Alibaba Cloud Toolkit icon is displayed in the toolbar.
Configure an Alibaba Cloud Toolkit account
When you use Alibaba Cloud Toolkit to deploy applications to Alibaba Cloud, you must call the API operations of Alibaba Cloud services. When you call the API operations, you must use an AccessKey pair that consists of an AccessKey ID and an AccessKey secret for authentication in the cloud. Therefore, before you deploy applications, configure account information in Alibaba Cloud Toolkit.
- Obtian an AccessKey pair.
- Start Eclipse.
- In the top navigation bar, choose .
- In the left-side navigation pane of the Preferences page, choose Alibaba Cloud Toolkit > Accounts.
- On the Accounts page, configure the Access Key ID and Access Key Secret parameters and click Apply and Close.
Deploy an application to SAE
Alibaba Cloud Toolkit allows you to deploy applications to SAE by using WAR packages, JAR packages, or images.
- In the Package Explorer section on the left side of the Eclipse page, right-click the name of your application project and choose .
- In the Deploy to SAE dialog box, configure the Region, Namespace, and Application parameters based on your business requirements and configure the deployment method. Note If you have not created an application in the SAE console, click Create Serverless Application on SAE console in the upper-right corner of the dialog box to go to the SAE console.
The following table describes the deployment parameters.
Parameter Parameter Description Application Region The region where the application resides. Namespace The namespace to which the application belongs. Application The name of the application. Deploy File Maven Build If you select Maven Build to build the application, the system adds a Maven job to build the deployment package. Upload File If you select Upload File to build the application, upload your WAR package or JAR package and then deploy the application. Image Address If you select Image to build the application, enter an image address and then deploy the application. Note If you use a JAR package or a WAR package to deploy an application in the SAE console, you can select only Maven Build or Upload File when you use Alibaba Cloud Toolkit to deploy the application. If you use an image to deploy an application in the SAE console, you can select only Image when you use Alibaba Cloud Toolkit to deploy the application. - After you configure the settings, click Deploy.
- After the deployment process starts, Eclipse prints deployment logs in the Console section. You can view the logs to check whether the deployment is successful.
- You can log on to the SAE console and view the change records of the application on the Change Records page.
Stop the Alibaba Cloud Toolkit plug-in
If you want to run other plug-ins when the Alibaba Cloud Toolkit plug-in is running, stop the SAE-deploy process on the Progress page.
Deploy a multi-module project
- Method 1: Run the packaging and deployment commands in your parent project.
To use this method, you must use toolkit-maven-plugin V1.0.3 or later.
When you run the
toolkit:deploy
command in your parent project, add the-Ddeploy_artifacts
parameter to specify the artifact ID of the submodule that you want to deploy. If you want to deploy multiple submodules, separate them with commas (,).The following example shows the submodules of the CarShop project:
carshop itemcenter-api itemcenter detail
To deploy the itemcenter and detail submodules, run the following command in the carshop directory:
mvn clean package toolkit:deploy -Ddeploy_artifacts=itemcenter,detail
By default, the plug-in separately deploys the corresponding applications based on the
.edas_config.yaml
files of the itemcenter and detail submodules. You can also add the-Dedas_config
parameter to specify the configuration file. - Method 2: Run the packaging and deployment commands in your submodule. All the toolkit-maven-plugin versions support this method.
Run the
install
command in your parent project to install the dependencies of the submodule to your Maven local repository. Then, go to the directory of the submodule that you want to deploy and run thetoolkit:deploy
command.
References
Operation | References |
Lifecycle management operations, such as updating, starting, stopping, and deleting an application, and scaling in or scaling out the instances for an application | |
Performance optimization operations, such as configuring auto scaling policies for an application, binding Server Load Balancer (SLB) instances to an application, and starting or stopping applications in batches | |
Application status-based operations, such as managing logs, configuring monitoring settings, viewing application events, and viewing change records |