All Products
Search
Document Center

CloudOps Orchestration Service:Build a software package and upload it to OSS

Last Updated:Sep 10, 2026

Pull code from a Git repository, build a software package, and upload it to Object Storage Service (OSS). This template is suitable for scenarios in which you want to build a software package and store it in OSS. The template supports building on an existing Elastic Compute Service (ECS) instance in your account or on a temporary instance that is released after the build.

Prerequisites

Sample template

  1. You specify the code source, such as Object Storage Service (OSS) or Git. CloudOps Orchestration Service (OOS) generates a temporary URL to pull code from the specified source.

  2. Build a software package such as a JAR package and upload it to OSS.

Example

Prepare the code source

This example uses a sample Spring Boot project. The code is available in Gitee and GitHub repositories. Before you start, fork the project to your own repository.

Create a template

  1. Log on to the CloudOps Orchestration Service console.

  2. In the left-side navigation pane, choose automated task > custom task template, and then click Create Template.

  3. Select Build a software package, upload it to OSS, and then deploy it and click Next Step.

  4. On the Process Configuration tab, set the parameters and click Create Template.

    1. Specify a code source to generate a temporary authorization link for pulling the code.

      This example uses Gitee as the code source. Enter the Owner, Organization, repository, and branch for your repository.

      Note
      • If you have not authorized Alibaba Cloud to read your repositories from GitHub or Gitee, click Go to Authorization to grant access.

      • If you have already forked the sample code, your repositories are automatically listed in the repository drop-down list. Select the forked repository.

    2. Build a software package such as a JAR package and upload it to OSS.

      1. Select the code source and the ECS instance, and then provide the build command.

        • CodeResource: In this example, git is selected. The output of the previous task is used, which is authorizedUrl.

        • Choose Building Ecs: Select Existing ECS or New ECS as the build instance.

          Note

          If you select New ECS, you are charged on a pay-as-you-go basis. OOS checks whether Docker is installed on the instance. If Docker is not installed, OOS installs Docker Community Edition automatically.

        • Build Configuration: Provide build commands as needed.

          This topic provides only a sample build and deployment script. When you run the script, Maven is installed first and then a JAR package is created in the target directory. You can replace the sample script with one that suits your project.

          Sample script (Alibaba Cloud Linux 3)

          ### sample build script
          set -e
          yum install -y maven-3.5.4
          mvn package

          Sample script (Ubuntu)

          ### sample build script
          set -e
          apt install -y maven
          mvn package

          Sample script (CentOS)

          ### sample build script
          set -e
          yum install -y maven
          mvn package
      2. Provide the package path and the build name, which is the name of the package to be created.

        In this example, the package path is target/. OOS compresses the package into a .tgz file.

    3. Upload the build output to OSS.

      Specify the OSS bucket and object path for the software package.

    4. Click Create Template.

Execute the template

  1. Log on to the CloudOps Orchestration Service console.

  2. In the left-side navigation pane, choose automated task > custom task template.

  3. On the custom task template page, find the template that you created and click Create an execution in the Actions column.

  4. In the Basic Information step, configure the parameters and click Next: Set Parameters.

  5. In the Parameter Settings step, if no changes are needed, click Next: Confirm.

  6. Click Create.

    On the task execution management page, a status of Successful indicates that the execution is complete.

  7. Log on to the OSS console. Find the specified bucket and path to view the uploaded software package.

What to do next

When your code is updated, push it to the corresponding Git repository and run the template again. OOS pulls the latest code, builds the package again, and uploads it to OSS. You can also modify the template before running it.