The content of this page has been automatically translated by AI. If you encounter any problems while reading, you can view the corresponding content in Chinese.
Help & Documentation>CODING DevOps>Continuous Deployment>Deployment mode>Trigger When Docker Artifacts Are Auto Released

Trigger When Docker Artifacts Are Auto Released

Last updated: 2024-09-05 16:44:07

One major advantage of CODING-CD is its ability to easily integrate upstream and downstream products into the workflow. The following will demonstrate how to implement continuous integration task push artifacts > artifact repository image update > trigger deployment process, a basic automated pipeline configuration.

Operation step

Step 1: Associate the application with the project

In the deployment process console, the application needs to be associated with the project in advance. Go to the App Center, click the project association icon in the application, select the project where the continuous integration configuration is located, and associate it.


Step 2: Configure CI process

This step pushes artifacts to the artifact repository through CI. You can create a CI process from the CI plan template, or add this stage by writing a Jenkinsfile.

Add this stage to the CI process:

Jenkinsfile reference:
stage('Push to CODING Docker artifact repository') {
steps {
script {
docker.withRegistry(
"${env.CCI_CURRENT_WEB_PROTOCOL}://${env.CODING_DOCKER_REG_HOST}",
"${env.CODING_ARTIFACTS_CREDENTIALS_ID}"
) {
docker.image("${CODING_DOCKER_IMAGE_NAME}:${env.DOCKER_IMAGE_VERSION}").push()
}
}
}

Step 3: Trigger According to Artifact Image Version

Go to the application deployment process in continuous deployment, click the trigger switch in basic configuration. Here, choose to trigger by CODING Docker artifact update, monitoring the artifact version number in the associated project. If continuous integration pushes the artifact to the artifact repository, it will automatically trigger the deployment process; choosing by Definition can monitor artifact repository updates from other projects.
In addition to CODING Docker Repository Trigger, you can also select Git Repository Trigger or Scheduled Trigger.