Setting up a Multi-Cloud CI/CD Chain using Alibaba Tools

Image for post
Image for post

These days, having a continuous integration and delivery (CI/CD) pipeline in place is pretty much essential for any kind of software development. Therefore, the question isn’t so much if you should set up a CI/CD pipeline, but how.

And when it comes to the how of CI/CD, you have a lot of options. There are countless CI/CD solutions on the market, including commercial as well as open source platforms, both of which have their own distinct advantages and disadvantages over the other.

In this article, I outline the reasons why you may wish to use a commercial CI/CD platform, then walk through the steps of taking advantage of tools on Alibaba Cloud that allow you to set up a production-ready CI/CD pipeline.

Commercial vs Open Source

Many commercial CI/CD platforms give back to the developer community by open-sourcing their CI/CD engines. While not every commercial platform open-sources their engine, and not every open source engine is backed by a commercial platform, these solutions provide a lot more control at the expense of ease-of-use. Spinning up an open source CI/CD platform is significantly more involved, and requires some sort of server to run on. Open source platforms are an excellent option for organizations that require more resources for their build processes, or even organizations that simply prefer to keep their code in-house whenever possible.

Alibaba + CI/CD

Deployments in a Nutshell

rsync -r --delete-after --quiet /path/to/build <ssh-user>@<ecs-host>:path/to/files

rsync is a command line utility that is used to synchronize files across servers. It has been around for a while — The rsync algorithm is well-known as having been used by Dropbox to deal with file synchronization. The beauty of this deployment method is that it can be used regardless of the hosting provider you use, which means that you can deploy to multiple cloud providers simultaneously, both internally at Alibaba Cloud, and externally.

It is important to note that, in order to successfully authenticate to our ECS instance, you will have to generate an SSH key and give your CI/CD platform access to it. While out of the scope of this article, Digital Ocean has an excellent guidefor generating SSH keys. (Take note: If you follow the Digital Ocean guide, you should not set up an SSH passphrase — otherwise your automated deploy process won’t be able to use your key.)

Executing Commands

ssh <ssh-user>@<ecs-host> -C "<migration-command>"

The -C option of the SSH command will execute any command within the login shell you have created. Using this principle, we can accomplish significantly more than running simple database migrations. This allows us to interact with various Alibaba Cloud services, such as clearing a cache that is stored in ApsaraDB for Redis, which can only be accessed from within the Alibaba Cloud Intranet.

Next Steps


Image for post
Image for post

Zachary Flower (@zachflower) is a Fixate IO Contributor and lead developer at Emerson Stone, a Boulder-based design and branding agency. He has an eye for simplicity and usability, and strives to build products with both the end user and business goals in mind. From building projects for the NSA to creating features for companies like and Buffer, Zach has always taken a strong stand against needlessly reinventing the wheel, often advocating for the use of well established third-party and open source services and solutions to improve the efficiency and reliability of a development project.


Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store