When your business needs change, you can modify a delivery chain. For example, you can modify the image building rules, the blocking rule for image security scanning, image synchronization rules, and distribution triggers for a delivery chain as required. This topic describes how to modify or delete a delivery chain.
Modify basic information about a delivery chain
Modify basic information about a delivery chain, such as the delivery chain name and description.
Log on to the Container Registry console.
In the top navigation bar, select a region.
In the left-side navigation pane, click Instances.
On the Instances page, click the Enterprise Edition instance that you want to manage.
On the management page of the Container Registry Enterprise Edition instance, choose in the left-side navigation pane.
On the Chain page, select the namespace of the delivery chain that you want to modify.
Note
By default, this page lists the delivery chains in all namespaces.
Find the delivery chain that you want to modify and click Manage in the Actions column.
In the Details section, click Edit next to the Name or Description parameter to modify the name or description of the delivery chain based on your requirements. Then, click Confirm.
Modify image building rules
You can create, modify, or delete image building rules as required.
Modify an image building rule
In the Chain section, click Image Building.
Find the image building rule that you want to modify and click Modify in the Actions column.
In the Build Information step, configure the following parameters and click Next.
Parameter | Description |
Type | Specify the type of the source code repository. Valid values: Branch and Tag. |
Branch/Tag | Select or enter a branch or a tag. Regular expressions are supported. If you specify the release-(?<imageTag>\w*) regular expression, the system automatically builds an image of V1 when the source code in the release-v1 branch is updated. You cannot manually build the image. For more information about how to specify regular expressions, see Use regular expressions in named capturing groups. Note After you specify regular expressions, images can be built only by the system. You cannot manually build images. |
Dockerfile Directory | Specify the directory of the Dockerfile. You must specify a relative directory. The parent directory is the root directory of the code branch. |
Dockerfile Filename | Specify the name of the Dockerfile. The default name is Dockerfile. |
In the Tag step, configure parameters, click Save, and then click Next. The following table describes the parameters.
Note
Click Add Configuration to add image tags. You can add up to three image tags.
Parameter | Description |
Image Tag | The tag of the image. Example: latest. You can enable named capturing groups. For example, if you specify a named capturing group for Branch/Tag, you can use the captured content. |
Build Time | The time (UTC+8) when source code is pushed. Example: 20201015 or 202010151613. Note This parameter is optional. If you set this parameter, only the system can build images. You cannot manually build images. |
Commit ID | The number of characters to be obtained from the commit ID of the most recently pushed code. By default, the first six characters are used. You can adjust the slider to change the number of characters. Note This parameter is optional. If you set this parameter, only the system can build images. You cannot manually build images. |
In the Build Information step, configure the following parameters and click Next.
Parameter | Description |
The type of the media | Specify the type of the source code repository. Valid values: Branch and Tag. |
Branch/Tag | Select or enter a branch or a tag. Regular expressions are supported. If you specify the release-(?<imageTag>\w*) regular expression, the system automatically builds an image of V1 when the source code in the release-v1 branch is updated. The image cannot be built immediately. For more information about how to specify regular expressions, see Use regular expressions in named capturing groups. Note After you specify regular expressions, images can be built only by the system. You cannot manually build images. |
Dockerfile Directory | Specify the directory in which the Dockerfile resides. You must specify a relative directory. The parent directory is the root directory of the code branch. |
Dockerfile Filename | Specify the name of the Dockerfile. |
In the Build Configurations step, configure parameters and then click Confirm. The following table describes the parameters.
Parameter | Description |
Build Architecture | The architecture for which you want to build images. You can select multiple architectures. If you select multiple architectures, multiple container images for the architectures are built for each image tag. |
Build Parameters | The runtime parameters of the image building. Each building parameter is a key-value pair that is case-sensitive. You can configure a maximum of 20 building parameters. |
Delete an image building rule
In the Chain section, click Image Building.
Find the image building rule that you want to delete and click Delete in the Actions column.
In the Delete message, click OK.
Modify the blocking rule for image security scanning
You can modify the blocking rule for image security scanning based on your security requirements.
In the Chain section, click Security Scan.
In the Node configuration section, configure the blocking rule.
Modify image synchronization rules
You cannot directly modify image synchronization rules of a delivery chain. If an image synchronization rule needs to be modified, you can delete it and create another one.
Create an image synchronization rule
In the Chain section, click Trigger Synchronization. Then, click Create Rule.
In the Create Rule dialog box, enter a rule name, specify the destination Container Registry Enterprise Edition instance, and then click Next.
Note
If Internet access is disabled, images can be automatically replicated in different regions.
In the Replication Information wizard, configure the replication information of the source instance and click Create Rule.
Parameter | Description |
Replication Level | Select the replication level. Valid values: Namespaces and Repository. |
Source Address | Specify a namespace and a repository. Enter a regular expression to filter image tags in the repositories of the namespace or in the specified repository. By default, all image tags are replicated. You can specify the source repository only if you set the Replication Level parameter to Repository. |
Delete an image synchronization rule
In the Chain section, click Trigger Synchronization.
Find the image synchronization rule that you want to delete and click the
icon in the Actions column.
In the Delete message, click OK.
The Delete Successfully message appears.
Modify distribution triggers
You can modify distribution triggers to change the rules for redeploying applications.
In the Chain section, click Distribution Trigger.
Find the trigger that you want to modify and click Modify in the Actions column.
In the Modify Trigger dialog box, modify the following parameters as required 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. |
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 an event notification rule
If you want to change the redeployment rule of an application, you can modify the event notification of the image. If no event rule is available, You can click Create Rule. For more information, see Create an event notification rule.
In the Chain section, click Distribution Trigger.
Click Modify in the Actions column that corresponds to the event rule that you want to modify.
In the Modify Rule dialog box, modify the following information and then click OK.
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.
In this example, the event type of image scan is used. Select "cr:Artifact:ScanCompleted The image is scanned" and then select Scanned. |
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 a delivery chain that is no longer needed.
Log on to the Container Registry console.
In the top navigation bar, select a region.
In the left-side navigation pane, click Instances.
On the Instances page, click the Enterprise Edition instance that you want to manage.
On the management page of the Container Registry Enterprise Edition instance, choose in the left-side navigation pane.
On the Chain page, find the delivery chain that you want to delete and click Delete in the Actions column.
In the Delete message, click OK.
The Delete Successfully message appears.