All Products
Search
Document Center

Alibaba Cloud DevOps:Deploy artifact to host

Last Updated:May 19, 2025

Flow supports deploying artifacts to public hosts. Learn how to connect to hosts and deploy them.

Overview

  1. Connect to a new host.

  2. Create a host deployment job.

  3. Configure a host deployment job.

  4. Manage host deployment jobs: View deployment details or Roll back to a historical deployment.

Connect to a new host

  1. On the homepage of Flow, click Global Settings.

  2. On the left-side navigation bar, select Host Group Management.

  3. Select the target host group and click Add New Host.

  4. Select Manually Install Runner. This works for both Alibaba Cloud ECS and non-Alibaba Cloud hosts.

  5. Copy the Runner installation command and execute it on the new host. You need to make sure the host have access to the Internet.image

  6. When the following information appears in the host terminal, the connection is established. Refresh the host list page to check that the host is added.

INFO[2025-04-29T13:34:12+08:00] service type linux-systemd, user , realUser root 
INFO[2025-04-29T13:34:12+08:00] Aliyun yunxiao runner-v0.3.1-be-d5zh**** service started 
INFO[2025-04-29T13:34:12+08:00] Aliyun yunxiao runner-v0.3.1-be-d5zh**** service status running 

Create a host deployment job

Two methods are available:

Create through a pipeline template

  1. On the Flow homepage, navigate to My Pipelines.

  2. Click Create Pipeline.

  3. Select a pipeline template with a Host Deployment job

image

Create when building a pipeline

  1. On the Flow homepage, navigate to My Pipelines.

  2. Select a pipeline by clicking its name.

  3. Click Edit.

  4. On the Process Configuration page, click Create Job

  5. In the panel that appears, navigate to Deploy

  6. Select VM Deploy.

image

Configure a host deployment job

This section takes the deployment of Java sample code as an example to show how to configure a deployment job. Make sure to upload the deploy.sh file to the artifact repository as it is required later for deploying the Java code.

  1. Keep Download Artifacts During Deployment selected. (Selected by default. Do not deselect it.)

  2. Select an naming format of Artifact.

  3. Select an Host Group. (Click New Host Group to create one if no group exists.) Hosts in the host group must have Java runtime environment installed.

  4. Fill in the following items in Deployment Configuration:

    1. Artifact Download Path: The path on your host where the artifacts will be downloaded.

    2. Execute User: The user allowed to execute the commands.

    3. Deploy Script:

      # In this example, to deploy the sample code, just extract and execute the package.
      mkdir -p /home/admin/application
      tar zxvf /home/admin/app/package.tgz -C /home/admin/application/
      sh /home/admin/application/deploy.sh restart
      deploy.sh is a shell script that starts a JAR package. Replace it with your own deployment script in practice.
      Important

      During the deployment, Flow will initiate deployment processes that start with rdc_deploy_command_. Do not operate on these processes in your deployment script, or the deployment may fail.

  5. Configure the Deployment Strategy. Flow supports staged deployment.

    1. Pause Strategy

      1. FirstBatchPause: The deployment procedure pauses upon the completion of the first batch, waiting for your confirmation to deploy the rest.

      2. No Pause: Upon completion of a batch, the subsequent batch is executed automatically without pausing for your confirmation.

      3. EveryBatchPause: The deployment procedure pauses upon the completion of each batch, waiting for your confirmation to deploy the next one.

    2. Batch Number: The hosts will be deployed in batches based on the specified number. For example, if you have 4 hosts and choose to deploy in 2 batches, each batch will automatically deploy to 2 hosts.

image

Note

See Environment variables configuration if required in deployment.

Manage host deployment jobs

View deployment details

After configuring the deployment job, run the pipeline to deploy the artifacts to the specified host group. Click Deployment Order Details to view the latest deployment status.

image

Deployment status

Available operations

Deploying

  • Stop.

  • View logs.

To be deployed

No operation is available in this stage.

Completed

  • View logs.

Failed

  • Retry.

  • View logs.

Skipped

  • View logs.

Roll back to a historical deployment

In the Deployment History, Roll Back to the target historical deployment.

Flow will re-run historical deployment script and re-build artifacts based on the history to achieve the rollback.

image

Warning

Deployment artifacts have a 30-day retention period. Rollbacks to deployments older than 30 days are not allowed.