Deploy applications to ECS using IntelliJ IDEA

更新时间:
复制 MD 格式

If you have an Alibaba Cloud ECS instance, you can use Cloud Toolkit to quickly deploy applications. This topic describes how to use Cloud Toolkit in IntelliJ IDEA to deploy an application to an ECS instance.

Prerequisites

Precautions

Due to a limitation in Cloud Assistant, you can only use the root account for deployment in this tutorial. To use a different account for deployment, use one of the following methods:

Procedure

  1. Open your project in IntelliJ IDEA.

  2. In the IntelliJ IDEA menu bar, choose Tools > Alibaba Cloud > Deploy to ECS....

  3. In the Deploy to ECS dialog box, set the deployment parameters, and then click Run.

    The following list describes the parameters:

    • Deploy File: Select Maven Build or Upload File.

      • Maven Build: Builds and deploys the current project if it uses Maven.
      • Upload File: Uploads a local file. Use this option if the project does not use Maven, or if a compressed deployment package already exists on your local machine.
      • Gradle Build: Builds and deploys the current project if it uses Gradle.
    • Target ECS: Select the target ECS instance.
      1. Click +.
      2. In the Select ECS dialog box, select the target Account and Region.
      3. In the instance list, select the target ECS instance and click Select.
    • Target Directory: Enter the deployment path on the ECS instance. For example:
      ## Deployment directory:
      /root/tomcat/webapps
      ## Deployment directory:
      /root/springbootdemo
      ## Deployment directory:
      /root/go-demo
      ## Deployment directory:
      /root/nodejs-demo
    • Command: The command to run after the application package is deployed. This is typically a startup command. For example:
      sh /root/restart.sh
      Note For more information about commands, see Guidelines for writing commands.

Verify the results

After the deployment starts, deployment logs are displayed in the Console pane of IntelliJ IDEA. You can check the logs to verify the deployment result.