You can create a repository based on the projects on Github, Bitbucket, and Gitlab. We recommend that you select Automatically create an image when the code changes in Build Setting. Then, when you modify the code, the automatic build of the repository is triggered and the new images are pushed to Alibaba Cloud Container Registry.
We recommend that you set the project master branch to the latest image version. Then, if you want to use this repository image, you can directly use
reigstry.aliyuncs.com/**/dockertest, without specifying a tag as the latest version. The stable master branch is used by default to create the stable latest image version.
Click Build Now on the repository details page to build a repository using the preceding two build rules.
After you submit the modified code in the test branch of the source code repository, the repository is automatically built based on the second build rule and generates new versions of images.
Repository Webhook can subscribe to events generated by new image versions. We recommend that you generate a request URL using
http://requestb.in/ and bind it to the repository Webhook. When new images are generated, you can see the access history of Webhook.
The time, parameters, and results of the request are displayed in details. The request parameters provide the information about the current repository.
Log on to the Container Service console and click Applications in the left-side navigation pane. Select the cluster from the Cluster list and click the name of the created application to enter the application details page. Click Create Trigger to create a redeployment trigger and copy the trigger URL.
Return to the image information page. Create a Webhook and enter the trigger URL.
After you modify the code in the source code repository, the container images are automatically built and the redeployment of the corresponding applications in Container Service is automatically triggered.