When your business needs change, you can modify the image build rules, security scan blocking rules, image synchronization rules, and image distribution rules of a delivery chain.
Modify basic information
You can modify basic information such as the name and description of a delivery chain. Before you begin, make sure that you have created a delivery chain.
This feature is available only in the Premium edition of Enterprise Edition instances.
Log on to the Container Registry console.
In the top navigation bar, select a region.
-
In the left navigation pane, click Instances.
On the Instances page, click the Enterprise Edition instance that you want to manage.
-
In the left navigation pane of the management page for the Enterprise Edition instance, choose .
-
On the Delivery Chain page, from the Namespace drop-down list, select the namespace of the delivery chain that you want to modify.
NoteBy default, delivery chains in all namespaces are listed.
-
In the Actions column, click Manage for the delivery chain that you want to modify.
-
In the Basic Information section, click Edit next to the delivery chain name or description, modify the values as needed, and then click Confirm.
Modify image build rules
If you need to change your image build rules, you can modify, add, or delete them.
Modify an image build rule
-
In the visualization area of the delivery chain, click Image Building.
-
In the Actions column, click Modify for the target rule.
-
In the Build Information wizard, set the parameters and click Next.
Parameter
Description
Type
The type of the source code repository. Valid values: Branch and Tag.
Branch/tag
Select or enter the Branch/Tag, which supports regular expressions. When the regular expression is release-(?<imageTag>\w*), it will detect source code changes in
release-v1and automatically build an image with the tagv1(Immediate builds are not supported). For more information, see Named Capturing Groups in Regular Expressions.NoteWhen you use a regular expression, only automatic builds are supported. Manual or immediate builds are not supported.
Dockerfile Directory
The path to the Dockerfile directory, relative to the root of the code branch.
Dockerfile Filename
The name of the Dockerfile. Default value: Dockerfile.
-
In the Image Version wizard, set the parameters, click Save, and then click Next.
NoteClick Add Configuration to add image versions. You can add a maximum of three image versions.
Parameter
Description
Image Version
The image tag, such as latest. Named capturing is supported. For example, you can use the content captured in Branch/Tag.
Build Time
The time when the source code was pushed. The time is in UTC+8. Supported formats are YYYYMMDD (for example, 20201015) and YYYYMMDDHHMM (for example, 202010151613).
NoteThis parameter is optional. If you select this parameter, only automatic builds are supported. Manual or immediate builds are not supported.
Commit ID
The commit ID of the last code push. By default, the first six characters are used. You can move the slider to specify the number of characters.
NoteThis parameter is optional. If you select this parameter, only automatic builds are supported. Manual or immediate builds are not supported.
-
In the Build Information wizard, set the parameters and click Next.
Parameter
Description
Type
The type of the source code repository. Valid values: Branch and Tag.
Branch/tag
Select or enter a branch or tag. Regular expressions are supported. If the regular expression is
release-(?<imageTag>\w*), changes to therelease-v1source code trigger an automatic build for an image tagged asv1. Immediate builds are not supported. For more information, see Named capturing groups in regular expressions.NoteIf you specify a regular expression, only automatic builds are supported. Manual or immediate builds are not supported.
Dockerfile directory
The path to the Dockerfile directory, relative to the root of the code branch.
Dockerfile filename
The name of the Dockerfile.
-
In the Build Configurations wizard, set the build parameters and click Confirm.
Parameter
Description
Build Architecture
A single image version can include images for multiple architectures. Parallel builds are supported.
Build Parameters
The runtime parameters for the image build. The build parameters are case-sensitive key-value pairs. You can add a maximum of 20 build parameters.
On the Instances page of the Container Registry console, you can view the created Enterprise Edition and Personal Edition instances and their running status. Click Manage for the target Enterprise Edition instance to go to its details page to modify the image build rules.
Delete a build rule
-
In the visualization area of the delivery chain, click Image Building.
-
In the Actions column, click Delete for the rule that you want to delete.
-
In the Delete dialog, click Confirm.
Modify security scan blocking rules
Modify the security scan blocking rules based on your security requirements.
-
In the visualization area of the delivery chain, click Security Scan.
-
In the Node configuration section, configure the blocking rule.
-
Scan engine: You can select Security Center Scan Engine or Trivy Scan Engine.
After vulnerabilities are detected, the Security Center Scan Engine supports one-click fixes for vulnerabilities. The Trivy Scan Engine does not support this feature.
To use the image scan feature of Security Center, you must purchase the Ultimate edition of Security Center. For more information, see Purchase Security Center. If Security Center is not displayed in the console, it is not available in the current region.
-
Block:
-
Yes: The delivery chain stops if the scan results trigger a blocking rule.
You must configure a blocking rule based on Severity and Vulnerability. You must also specify the actions to take after the delivery chain is blocked, such as whether to delete the original image and whether to back up the image.
-
No: All image versions proceed to the subsequent steps regardless of scan results.
-
-
Manage image synchronization rules
Image synchronization rules in a delivery chain cannot be modified directly. To modify a synchronization rule, delete the existing rule and create a new one.
Add a synchronization rule
-
In the delivery chain navigation area, click Trigger Synchronization, and then click Create Rule.
-
In the Create Rule dialog box, enter a rule name, configure the destination instance, and then click Next.
-
Select a region and select an existing instance as the destination instance.
-
If a destination instance does not exist, click Create Instance. For more information, see Create an Enterprise Edition instance.
NoteIf Internet access is disabled, images can be automatically replicated in different regions.
-
-
In the Replication Information wizard, configure the source instance details and click Create Rule.
Parameter
Description
Replication Level
Select the replication level. Valid values: Namespaces and Repository.
Source Address
Select a namespace and repository name. Enter a regular expression to filter image tags. By default, all tags are replicated. You must select a specific source repository only if you set Replication Level to Repository.
Delete a synchronization rule
-
In the visualization area of the delivery chain, click Trigger Synchronization.
-
In the Actions column, click the
icon for the rule that you want to delete. -
In the Delete dialog, click Confirm.
The Delete Successfully message appears.
After you complete these steps, the selected synchronization rule is deleted.
Modify distribution triggers
If your application's redeployment rules change, you can modify its image distribution triggers.
-
In the visualization area of the delivery chain, click Trigger.
-
In the Actions column, click Modify for the trigger that you want to modify.
-
In the Modify Trigger dialog, modify the following information and click Confirm.
Parameter
Description
Name
The name of the trigger.
Trigger URL
The URL to which the trigger sends notifications. You can obtain the URL from the configurations of your Container Service for Kubernetes (ACK) cluster.For detailed steps,seeUse container image triggers to automatically update applications。
Trigger
The trigger method. Valid values:
-
All: Each time an image is updated, image distribution is triggered.
-
By RegExp: A regular expression is used to filter image tags. Image distribution is triggered only if an image tag matches the regular expression.
-
By Tags: Tags are used to filter images. Image distribution is triggered only if an image tag is in the specified tag list.
-
Modify event notifications
You can modify event notification rules to change how you are notified about activities within the delivery chain. If no event rule exists, click Create Rule. For more information, see Create an event notification.
-
In the visualization area of the delivery chain, click Trigger.
-
In the Actions column, click Modify for the event rule that you want to modify.
-
In the Rule dialog, modify the following information and click Confirm.
Parameter
Description
Rule Name
Specify the name of the event rule.
Event Type
Specify the type of the event that triggers event notifications. The following event types are supported:
-
cr:Artifact:SynchronizationCompleted: An image synchronization succeeds, fails, or is canceled.
-
cr:Artifact:BuildCompleted: An image build succeeds, fails, or is canceled.
-
cr:Artifact:ScanCompleted: An image scan succeeds or fails.
-
cr:Artifact:DeliveryChainCompleted: The processing of a delivery chain succeeds, fails, is canceled, or is denied.
-
cr:Artifact:SigningCompleted:: Image tagging succeeds or fails.
This topic uses image scanning as an example. Select Image Scan Completed, and then select the Completed checkbox.
Effective scope
Specify the effective scope of the event:
-
Instance: Set the regular expression for image tags. An event notification is triggered when an image tag in the Enterprise Edition instance meets the regular expression.
-
Namespace: Select a namespace and set the regular expression for image tags. An event notification is triggered when an image tag in the namespace meets the regular expression.
-
Repository: Select a namespace and a repository, and then set the regular expression for image tags. An event notification is triggered when an image tag in the image repository meets the regular expression.
-
Delete a delivery chain
You can delete delivery chains that are no longer needed.
Log on to the Container Registry console.
In the top navigation bar, select a region.
-
In the left navigation pane, click Instances.
On the Instances page, click the Enterprise Edition instance that you want to manage.
-
In the left navigation pane of the management page for the Enterprise Edition instance, choose .
-
On the Chain page, in the Actions column, click Delete for the delivery chain that you want to delete.
-
In the Delete dialog, click Confirm.
A Delete Successfully message is displayed.