Summary

A hands-on tutorial on setting up GitLab CI/CD from scratch, covering the fundamentals of Continuous Integration and Continuous Deployment, the structure of .gitlab-ci.yml pipeline scripts, GitLab Runners, and job stages. The article reviews CI/CD concepts and explains how GitLab’s built-in CI/CD differs from third-party tools like Jenkins.

從頭介紹如何設定 GitLab CI/CD 的實作教程,涵蓋持續整合/持續部署的基本概念、.gitlab-ci.yml pipeline 腳本結構、GitLab Runners 和作業階段,並說明 GitLab 內建 CI/CD 與 Jenkins 等第三方工具的差異。

Key Points

  • GitLab CI/CD is built-in; no third-party integrations required (unlike Jenkins)
  • CI (Continuous Integration): every push triggers automated build and test, detecting errors early
  • CD (Continuous Deployment): automated deployment eliminates manual intervention and human error
  • Pipeline defined in .gitlab-ci.yml at repo root; stages (build, test, deploy) run sequentially
  • GitLab Runners execute the pipeline jobs on configured infrastructure

Insights

GitLab’s competitive advantage over GitHub/Jenkins setups is the fully integrated developer platform: the same tool that hosts code also runs CI/CD, tracks issues, and manages releases. For teams that don’t need the flexibility of a multi-tool pipeline, this eliminates a significant integration maintenance burden. The .gitlab-ci.yml as code approach means pipeline configuration is versioned alongside the application.

Connections

Raw Excerpt

GitLab CI/CD 是 GitLab 內建強大的工具,可以讓我們持續整合和部署,且不需要使用第三方的應用程式來整合。