- What's new
- Function Overview
- Service Overview
- Getting Started
-
User Guide
- Introduction
- Permissions Management
- Basics of the Container Engine
-
Image Management
- Uploading an Image Through a Container Engine Client (Recommended)
- Obtaining a Long-Term Valid Login Command
- Uploading an Image Through SWR Console
- Pulling an Image
- Setting Image Attributes
- Sharing a Private Image
- Adding a Trigger
- Adding an Image Retention Policy
- Configuring Automatic Image Synchronization Between Regions
- Image Center
- Organization Management
- User Permissions
- Auditing
- Change History
- Best Practices
-
API Reference
- Before You Start
- Calling APIs
- API Overview
-
API
- Organization Management
- Managing Image Repositories
- Image Tag Management
- Shared Account Management
- API Version
- Organization Permission Management
- Image Permission Management
- Image Synchronization Management
- Trigger Management
- Image Retention Policy Management
- Temporary Login Command
- Quota Management
- Other
- Example Applications
- Appendixes
- SDK Reference
-
FAQs
- General FAQs
- Login Issues
- Synchronizing Images
- Pushing an Image
- Pulling an Image
-
Troubleshooting
- Why Does the Login Command Fail to Be Executed?
- Why Does an Image Fail to Be Pushed Through a Container Engine Client?
- Why Does an Image Fail to Be Uploaded Through SWR Console?
- Why Does the docker pull Command Fail to Be Executed?
- What Should I Do If Images Cannot Be Downloaded from Private Networks?
- What Do I Do If an Error Occurs When I Call an API?
-
Other FAQs
- Why Does a CCE Workload Cannot Pull an Image from SWR and a Message "Not Logged In" Is Displayed?
- How Many Tenants Can I Share an SWR Private Image With?
- Why Is an Image Pushed Using a Container Engine Client to SWR Different in Size From One Uploaded Through the SWR Console?
- Can I Pull Images on the SWR Console to a Local PC?
- Videos
- Glossary
-
More Documents
- User Guide
- API Reference
- User Guide (Paris Regions)
- API Reference (Paris Regions)
- User Guide (Kuala Lumpur Region)
- API Reference (Kuala Lumpur Region)
-
User Guide (Ankara Region)
- Service Overview
- Overview
- Permissions Management
- Basics of Docker
-
Image Management
- Pushing an Image Through a Container Engine Client
- Obtaining a Long-Term Valid Docker Login Command
- Obtaining a Long-Term Valid containerd Pull/Push Command
- Uploading an Image Through the SWR Console
- Pulling an Image
- Setting Image Attributes
- Sharing Private Images
- Adding a Trigger
- Adding an Image Retention Policy
- Organization Management
- User Permissions
- FAQs
-
API Reference (Ankara Region)
- Before You Start
- API Overview
- Calling APIs
- API
- Appendixes
- Permissions and Supported Actions
- General Reference
Copied.
Adding a Trigger
Scenario
SWR works with Cloud Container Engine (CCE) to enable automatic application updates. This could be realized by adding a trigger to the desired images.
Prerequisite
A containerized application has been created on CCE by using an image from SWR.
If no applications have been created, log in to the CCE console and create one. For details, see Creating a Deployment or Creating a StatefulSet.
Procedure
- Log in to the SWR console.
- In the navigation pane on the left, choose My Images, and click the target image.
- Click the Triggers tab, then click Add Trigger. On the page displayed, configure the following parameters according to Table 1 and click OK.
Figure 1 Adding a trigger
Table 1 Trigger Parameter
Description
Name
The name of a trigger.
The name can contain 1 to 64 characters, and must start with a letter. Only letters, digits, underscores (_), and hyphens (-) are allowed. The name cannot end with an underscore or hyphen. Consecutive underscores or hyphens are not allowed and an underscore cannot be placed next to a hyphen.
Condition
The following trigger conditions are supported:
- All tags: Deployment is triggered when any image tags are generated or updated.
- Specific tag: Deployment is triggered when a specific image tag is generated or updated.
- Tags matching regular expression: Deployment is triggered when an image tag that matches the regular expression is generated or updated. The regular expression rules are as follows:
- *: matches any field that does not contain the path separator /.
- **: matches any field that contains the path separator /.
- ?: matches any single character except /.
- {option 1, option 2, ...}: matches multiple options.
Operation
Currently, only operation of updating images will be triggered. You need to specify the application to be updated and the container of the application.
Status
Select Enable.
Trigger Type
Select CCE.
Application
Select the container whose image you want to update.
Example 1: The trigger condition is All tags.
A Deployment named nginx is created using the Nginx image v1. The Deployment provides service to external systems with a welcome page displaying Hello, SWR!
- Add a trigger to the Nginx image.
Set Name as All_tags, Condition as All tags, and select the application and all its containers that use the Nginx image.
- Push the Nginx image v2 to SWR. The welcome page of the Deployment created using this new image should display Hello, SoftWare Repository for Container!
Figure 2 Image tag v2
- Check whether the deployment is triggered successfully.
On the Triggers tab page, locate the trigger and click Records to check whether the trigger is successful.
Figure 3 ResultThe welcome page of the Deployment displays Hello, SoftWare Repository for Container!
Example 2: The trigger condition is Tags matching regular expression.
A Deployment named nginx is created using the Nginx image v0. The Deployment provides service to external systems with a welcome page displaying Hello, SWR!
- Add a trigger to the Nginx image.
Set Name to Tags_regular_expression, Condition to Tags matching regular expression, regular expression to ^v2.*, and select the application and all its containers that use the Nginx image.
- Push the Nginx image v1 to SWR. The welcome page of the Deployment created using this new image should display Hello, SWR! (v1).
- Push the Nginx image v2 to SWR. The welcome page of the Deployment created using this new image should display Hello, SWR! (v2).
- Check whether the deployment is triggered successfully.
On the Triggers tab page, click
to check the result. As shown in Figure 4, only the deployment of the Nginx image v2 is triggered.
The welcome page of the Deployment displays Hello, SWR! (v2).
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot