ci

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 2 Imported by: 0

README

GitLab Main Project CI/CD Pipeline

This is the GitLab CE/EE main project's CI/CD pipeline, imported from gitlab-org/gitlab.

Overview

The GitLab main repository pipeline is one of the most comprehensive CI/CD configurations in the open-source world, demonstrating advanced GitLab CI/CD features and patterns.

Pipeline Characteristics

  • Project ID: 278964
  • Lines of Code: ~81 lines (simplified from complex YAML)
  • Stages: 18 stages including sync, preflight, prepare, build-images, test-frontend, test, qa, post-qa, pages, etc.
  • Language: Ruby (Rails), Go, JavaScript/Vue.js
  • Features Demonstrated:
    • Multi-stage pipeline with extensive parallelization
    • Advanced variable management
    • Template includes (SAST, Dependency Scanning, Secret Detection)
    • Component usage
    • Comprehensive testing strategies

Key Features

Multi-Stage Architecture
Stages: List("sync", "preflight", "prepare", "build-images",
  "release-environments", "fixtures", "lint", "test-frontend",
  "test", "post-test", "review", "qa", "post-qa", "pre-merge",
  "pages", "notify", "benchmark", "ai-gateway")
Security Scanning

The pipeline includes multiple security scanning templates:

  • SAST (Static Application Security Testing)
  • Dependency Scanning
  • Secret Detection
Advanced Configuration
  • Bundler checksum verification
  • Knapsack test splitting
  • Predictive test selection (Crystalball)
  • Coverage simplification
  • Auto-explain logging for performance analysis

What You Can Learn

  1. Large-scale pipeline organization - How to structure a pipeline for a monorepo
  2. Security best practices - Integration of multiple security scanning tools
  3. Test optimization - Predictive test selection and parallel execution
  4. Variable management - Extensive use of pipeline variables for configuration
  5. Template composition - Using GitLab templates and components

Source

Building This Example

Since this is imported as a single file without a go.mod, you can view the generated code but cannot build it directly. To use it:

# View the pipeline code
cat pipeline.go

# To create a buildable version, copy to a new directory and initialize:
mkdir my-gitlab-pipeline
cp pipeline.go my-gitlab-pipeline/
cd my-gitlab-pipeline
go mod init example/my-gitlab-pipeline
go mod tidy

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MainPipeline = pipeline.Pipeline{
	Stages: List("sync", "preflight", "prepare", "build-images", "release-environments", "fixtures", "lint", "test-frontend", "test", "post-test", "review", "qa", "post-qa", "pre-merge", "pages", "notify", "benchmark", "ai-gateway"),
	Variables: Json{
		"DISABLE_OPENCOLLECTIVE":                                  "true",
		"KNAPSACK_RSPEC_SUITE_REPORT_PATH":                        "knapsack/report-master.json",
		"CHECK_PRECOMPILED_ASSETS":                                "true",
		"GIT_SUBMODULE_STRATEGY":                                  "none",
		"GLCI_PREDICTIVE_RSPEC_MATCHING_TESTS_EE_PATH":            "rspec/matching_tests-ee.txt",
		"RSPEC_TEST_ALREADY_FAILED_ON_DEFAULT_BRANCH_MARKER_PATH": "rspec/test_already_failed_on_master.txt",
		"SEC_DECOMPOSED_DB":                                       "true",
		"FLAKY_RSPEC_SUITE_REPORT_PATH":                           "rspec/flaky/report-suite.json",
		"ENABLE_DEPSCORE":                                         "true",
		"DEFAULT_CI_IMAGE":                                        "${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/ci/${BUILD_OS}-${OS_VERSION}-slim-ruby-${RUBY_VERSION}-golang-${GO_VERSION}-node-${NODE_VERSION}-postgresql-${PG_VERSION}:rubygems-${RUBYGEMS_VERSION}-git-${GIT_VERSION}-lfs-${LFS_VERSION}-chrome-${CHROME_VERSION}-yarn-${YARN_VERSION}-graphicsmagick-${GRAPHICSMAGICK_VERSION}",
		"RSPEC_FAST_QUARANTINE_PATH":                              "rspec/fast_quarantine-gitlab.txt",
		"RSPEC_AUTO_EXPLAIN_LOG_PATH":                             "auto_explain/auto_explain.ndjson.gz",
		"BUNDLE_FROZEN":                                           "true",
		"RSPEC_FAIL_FAST_THRESHOLD":                               20,
		"RAILS_ENV":                                               "test",
		"DEFAULT_RSPEC_PREDICTIVE_JOB_TAGS":                       "${DEFAULT_JOB_TAG}",
		"AVERAGE_KNAPSACK_REPORT":                                 "true",
		"GLCI_PREDICTIVE_RSPEC_TESTS_MAPPING_PATH":                "crystalball/mapping.json",
		"ELASTIC_URL":                                             "http://elastic:changeme@elasticsearch:9200",
		"BUNDLE_GEMFILE":                                          "Gemfile",
		"CACHE_CLASSES":                                           "true",
		"FORCE_COLOR":                                             1,
		"GLCI_MEDIUM_RUNNER_REQUIRED":                             "",
		"GLCI_PREDICTIVE_RSPEC_PACKED_TESTS_MAPPING_PATH":         "crystalball/packed-mapping.json",
		"RSPEC_PROFILING_FOLDER_PATH":                             "rspec/profiling",
		"RETRY_FAILED_TESTS_IN_NEW_PROCESS":                       "true",
		"CLICOLOR_FORCE":                                          1,
		"FF_NETWORK_PER_BUILD":                                    "true",
		"BUNDLER_CHECKSUM_VERIFICATION_OPT_IN":                    "1",
		"TMP_TEST_FOLDER":                                         "${CI_PROJECT_DIR}/tmp/tests",
		"SIMPLECOV":                                               "true",
		"CI_FETCH_REPO_GIT_STRATEGY":                              "none",
		"GLCI_EXPORT_TEST_METRICS":                                "true",
		"NODE_OPTIONS":                                            "--max-old-space-size=10240",
		"REGISTRY_GROUP":                                          "gitlab-org",
		"ES_JAVA_OPTS":                                            "-Xms256m -Xmx256m",
		"REUSE_FRONTEND_FIXTURES_ENABLED":                         "true",
		"FF_TIMESTAMPS":                                           "true",
		"BUNDLE_WITHOUT":                                          "development",
		"NOKOGIRI_LIBXML_MEMORY_MANAGEMENT":                       "default",
		"GLCI_PREDICTIVE_RSPEC_TESTS_MAPPING_ALT_PATH":            "crystalball/mapping-alt.json",
		"PG_VERSION":                                              "16",
		"GLCI_PREDICTIVE_RSPEC_MATCHING_TESTS_FOSS_PATH":          "rspec/matching_tests-foss.txt",
		"JEST_MATCHING_TEST_FILES_PATH":                           "jest/matching_test_files.txt",
		"GLCI_PREDICTIVE_RSPEC_PACKED_TESTS_MAPPING_ALT_PATH":     "crystalball/packed-mapping-alt.json",
		"GLCI_GITLAB_ASSETS_HASH_FILE":                            "cached-assets-hash.txt",
		"GET_SOURCES_ATTEMPTS":                                    "3",
		"GITLAB_DEPENDENCY_PROXY_ADDRESS":                         "${GITLAB_DEPENDENCY_PROXY}",
		"GLCI_PREDICTIVE_CHANGED_FILES_PATH":                      "rspec/changed_files.txt",
		"GITLAB_WORKHORSE_FOLDER":                                 "gitlab-workhorse",
		"GIT_DEPTH":                                               "20",
		"GIT_STRATEGY":                                            "clone",
		"GLCI_PREDICTIVE_MATCHING_JS_FILES_PATH":                  "rspec/js_matching_files.txt",
		"RSPEC_LAST_RUN_RESULTS_FILE":                             "rspec/rspec_last_run_results.txt",
		"REGISTRY_HOST":                                           "registry.gitlab.com",
		"DANGER_DO_NOT_POST_INVALID_DANGERFILE_ERROR":             "1",
		"GLCI_PREDICTIVE_RSPEC_PIPELINE_TEMPLATE_YML":             ".gitlab/ci/rails/rspec-predictive.gitlab-ci.yml.erb",
		"DECOMPOSED_DB":                                           "true",
		"RUBYOPT":                                                 "--yjit",
		"GLCI_PRODUCTION_ASSETS_RUNNER_OPTIONAL":                  "gitlab-org-docker",
		"BUNDLE_INSTALL_FLAGS":                                    "--jobs=$(nproc) --retry=3",
		"DEFAULT_JOB_TAG":                                         "gitlab-org",
		"GITALY_TESTING_LOG_LEVEL":                                "debug",
		"GLCI_CACHED_SERVICES_FOLDER":                             "${CI_PROJECT_DIR}/tmp/services",
		"NODE_ENV":                                                "test",
		"GLCI_PREDICTIVE_FRONTEND_FIXTURES_MAPPING_PATH":          "crystalball/frontend_fixtures_mapping.json",
		"DOCS_GITLAB_REPO_SUFFIX":                                 "ee",
		"FF_USE_FASTZIP":                                          "true",
		"GITLAB_LARGE_RUNNER_OPTIONAL":                            "gitlab-org",
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL