CompTIA Linux+ (XK0-006)Automation, Orchestration and ScriptingEasy
A DevOps engineer is implementing a Continuous Integration/Continuous Delivery (CI/CD) pipeline for a new microservice. They need to ensure that after a successful build and passing unit tests, the Docker image for the microservice is pushed to a private Docker registry. Which stage in a typical CI/CD pipeline would this action most appropriately belong to?
- APublish/Release Stage
- BBuild Stage
- CTest Stage
- DDeploy Stage
Show answer & explanationAnswer & explanation
Correct answer: A. Publish/Release Stage
The 'Publish/Release Stage' is where artifacts (like Docker images) are stored in a repository and tagged for future deployment. This clearly separates the creation (build) and validation (test) from the act of making the artifact available for downstream processes.
Why the other options are wrong
- B. The Build Stage focuses on compiling code, creating executables, or building the initial Docker image, but not pushing it to a registry.
- C. The Test Stage is for running various tests (unit, integration, end-to-end) against the built artifact, not for storing it in a registry.
- D. The Deploy Stage involves taking the released artifact from the registry and deploying it to an environment (e.g., staging, production), which happens *after* it's been published.
CI/CD Publish/Release Stage
The phase in a CI/CD pipeline where validated build artifacts are stored in a central repository, making them available for deployment.
- Occurs after successful build and testing.
- Artifacts (e.g., Docker images, JARs, packages) are pushed to artifact repositories.
- Artifacts are often tagged with version numbers or commit hashes.
- Aims to create a stable, retrievable version of the software for deployment.
Memory trick: Code, Build, Test, Publish, Deploy: The CI/CD journey, step by step.