All Products
Search
Document Center

CloudOps Orchestration Service:Automate deployment with Jenkins, OOS, and OSS

Last Updated:Jun 08, 2026

Build a CI/CD pipeline that uses Jenkins to package a WordPress application, stores build artifacts in OSS, and deploys them to ECS instances through OOS batch tasks.

Background information

  • WordPress source code is available on GitHub.

  • CloudOps Orchestration Service: an automated O&M service provided by Alibaba Cloud for software version management and phased release. What is OOS?

  • OSS: stores the built software packages. Multiple storage types are supported. What is OSS?

  • Jenkins: an automation server that triggers software package updates in OSS and OOS. Jenkins official website.

  • Resource Orchestration Service (ROS): an automated resource deployment service provided by Alibaba Cloud that deploys cloud resources such as ECS, ApsaraDB RDS, and Server Load Balancer (SLB) that this system depends on with a few clicks. What is ROS?

Create a WordPress environment

Use ROS to create a WordPress environment with ECS and ApsaraDB RDS.

  1. Log on to the ROS console.

  2. In the left-side navigation pane, choose Templates > Sample Templates.

  3. On the Sample Templates page, find the template named Create a WordPress Environment Based on ECS and ApsaraDB for RDS and click Create Stack.

    Sample template

  4. Set the parameters and click Create.

    After the stack is created, it appears in the stack list:

    1

  5. Click the WordPressUrl link in the Value column to open the WordPress website.

    Open the URL in a browser to confirm the deployment.

Install and configure Alibaba Cloud CLI

This example uses macOS.

  1. Create a RAM user and obtain an AccessKey pair for Alibaba Cloud CLI.

    Create a RAM user.

  2. Install Alibaba Cloud CLI.

    brew install aliyun-cli
  3. Configure Alibaba Cloud CLI.

    aliyun configure
  4. Verify that Alibaba Cloud CLI is installed. The command output lists supported regions.

aliyun ecs DescribeRegions

Install and configure Jenkins

This example uses macOS. The Install Jenkins page covers other operating systems.

  1. Install the latest version.

    brew install jenkins
  2. Install the LTS version.

    brew install jenkins-lts
  3. Start Jenkins.

    brew services start jenkins-lts
  4. Open localhost:8080 in a browser.

  5. Copy the password from the provided directory, paste it in the Administrator password field, and then click Continue.

    3

  6. Install the default plug-ins.

    4

  7. Configure the username and password and then log on to Jenkins.

Use Jenkins to update a software package

  1. Click New Item on the homepage of Jenkins.

  2. Select Freestyle project, enter the project name, and click OK.

  3. Go to the Source Code Management tab, select Git, and then enter the repository URL.

    https://github.com/WordPress/WordPress.git
  4. Go to the Build tab, click Add build step, and select Execute shell. Copy the following script into the Command field. The script packages the WordPress master branch, uploads it to oss://wordpress-test-oos, and creates a software package named wordpress in OOS.

    version=`date +%s`
    # Generate the wordpress_$version.tar package.
    tar -cvf wordpress_$version.tar `find .|grep -v wp-config-sample.php|grep -v targets|grep -v .git|grep -v ^\.$`
    # Copy the package to OSS.
    /usr/local/bin/aliyun oss cp wordpress_$version.tar oss://wordpress-test-oos/wordpress_$version.tar
    templateName=wordpress
    # Specify the OSS path of the package and configure the installation script.
    # {
    #   "FormatVersion": "OOS-2020-01-01-Package",
    #   "Description": "",
    #   "Packages": [{
    #       "Name": "wordpress_$version.tar",
    #       "Location": "oss://wordpress-test-oos/wordpress_$version.tar",
    #       "InstallScript": "test -e wordpress || mkdir wordpress && cd wordpress && mv ../wordpress_$version.tar . && tar xvf wordpress_$version.tar > /dev/null && rm wordpress_$version.tar && cp -rf * /var/www/html/",
    #       "UninstallScript": "echo uninstall",
    #       "Targets": [{
    #           "PlatForm": "centos",
    #           "Architect": "x86_64"
    #       }]
    #   }]
    # }
    templateContent="{\"FormatVersion\":\"OOS-2020-01-01-Package\",\"Description\":\"\",\"Packages\":[{\"Name\":\"wordpress_$version.tar\",\"Location\":\"oss://wordpress-test-oos/wordpress_$version.tar\",\"InstallScript\":\"test -e wordpress || mkdir wordpress && cd wordpress && mv ../wordpress_$version.tar . && tar xvf wordpress_$version.tar > /dev/null && rm wordpress_$version.tar && cp -rf * /var/www/html/\",\"UninstallScript\":\"echo uninstall\",\"Targets\":[{\"PlatForm\":\"centos\",\"Architect\":\"x86_64\"}]}]}"
    # Update the software package in OOS.
    /usr/local/bin/aliyun oos CreateTemplate --TemplateName=$templateName --Content "$templateContent" || /usr/local/bin/aliyun oos UpdateTemplate --TemplateName=$templateName --Content "$templateContent"
    # Delete the temporary package.
    rm wordpress_$version.tar
  5. Click Save.

  6. Click Build Now to trigger the deployment pipeline. Check the deployment status in the Build History section.

    5

  7. View the deployment logs in Console Output.

    The build pulls code from Git, packages it with tar, uploads the package to OSS, and registers it in OOS. To view the package, go to Server Management > Extensions in the OOS console and click the Custom Extensions tab.

    6

  8. On the Custom Extensions tab, click Details to view the package name, storage location, installation script, uninstallation script, and version history.

    7

Deploy the software package from OOS

  1. Log on to the OOS console.

  2. In the left-side navigation pane, choose Automated Task > Common O&M Tasks > Batch Software Management, and then click Create.

  3. On the Create Task Batch Software Management page, select a public extension (WordPress-One-Click) and the instance, and then click Create.

    Note

    Select the instance created by ROS.

    image

  4. Configure a role for the instance by clicking Authorize.

    If the Select Instances button is disabled, configure a role for the instance. OOS uses this role to access packages in OSS. Skip this step if the button is active.

    9

    13

  5. Grant permissions to the role.

    • If an existing RAM role has the AliyunOOSReadOnlyAccess and AliyunOSSReadOnlyAccess policies attached with ECS as the trusted service, click Create. The execution is successful in the execution list.

    • To create a RAM role for the instance:

      1. Log on to the RAM console. On the Roles page, click Create Role. Select Alibaba Cloud Service as the trusted entity, select Elastic Compute Service as the trusted service, and click OK.

      2. Attach the AliyunOOSReadOnlyAccess and AliyunOSSReadOnlyAccess policies to the created RAM role.

        10

      3. Go to the Create Task Batch Instance Operations page, select Instance Operations as Task Type, click Add Role, and assign the RAM role to the instance.

  6. Return to the Create Task Batch Software Management page, select the instance with the RAM role, and click Create.

    11

  7. On the Task Execution Management page, check the execution status. If successful, the latest WordPress files are deployed to /var/www/html. Click Details to view execution logs.12

Conclusion

You have built a CI/CD pipeline with Jenkins and OOS. The OOS Extensions feature manages software versions and supports phased release. In Jenkins, you can also directly call the Extensions feature of OOS to automate the deployment process. To automate image updates, see the "Implement automated image updates by using Jenkins, OOS, and OSS" topic.