Overview of GoCD Architecture and Core Concepts
This article provides a comprehensive overview of GoCD, an open‑source continuous integration and delivery system, detailing its server‑agent architecture, key concepts such as tasks, jobs, stages, pipelines, materials, triggers, environments, resources, fan‑out/fan‑in, value‑stream mapping, and artifact handling.
This article, originally from the Chinese blog of Sun Lei (elisun), introduces GoCD – an open‑source continuous integration and continuous delivery system that originated in 2007.
Architecture Overview:
Server and Agents
- The Server controls configuration, polls for material changes (e.g., code repositories), and assigns jobs to Agents when a pipeline needs to be triggered.
- Agents receive jobs from the Server, execute the tasks (commands, deployments, etc.), and report job status back to the Server, which then determines the stage status.
- An agent must be installed on every machine that runs deployment jobs.
Key Concepts:
1. Task – Usually a single command such as a system command, Ant build, etc.
2. Job – Consists of multiple tasks executed sequentially; tasks are independent, and a job fails if any task fails.
3. Stage – Composed of multiple jobs that run in parallel; the stage fails if any job fails.
4. Pipeline – A sequence of stages; the pipeline fails if any stage fails.
5. Materials and Triggers – GoCD can poll Git, SVN, etc., to detect changes and trigger pipelines, or pipelines can be triggered manually.
6. Pipeline Dependency Material – Pipelines can depend on each other; completion of one pipeline can trigger another.
7. Resources – Labels attached to agents to indicate which agents can run a particular job (e.g., "Firefox").
8. Environments – Grouping and isolating pipelines and agents; pipelines assigned to an environment run only on agents belonging to that environment.
9. Environment Variables – Configurable at multiple levels; lower‑level values override higher‑level ones.
The final resolved values are:
ENV_ENV => 1
ENV_PIP => 2
ENV_STG => 3
ENV_JOB => 4
MY_VAR => 410. Fan‑out and Fan‑in
Fan‑out: Completion of a material triggers multiple downstream pipelines.
Fan‑in: Multiple upstream materials must be consistent before a downstream pipeline is triggered.
11. Value Stream Map (VSM) – End‑to‑end view of upstream/downstream dependencies, ensuring consistent revisions across pipelines.
12. Artifacts – Files or directories produced during pipeline execution; jobs can publish artifacts, which are then transferred from agents to the server for later retrieval.
Artifacts can be used by downstream pipelines or later stages via the "Fetch Artifact" task.
Example: Job 1 publishes two files and a directory; Job 2 publishes one file and two directories.
13. GoCD Server Home Page
Official website: https://www.gocd.org
The author is one of the creators of the product; it was previously known as "Cruise" and was introduced on a CSDN blog in 2008.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Continuous Delivery 2.0
Tech and case studies on organizational management, team management, and engineering efficiency
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
