2015-09-30 09:18:05 +00:00
stages :
2017-02-20 07:02:54 +00:00
- check
2016-12-16 05:51:40 +00:00
- prepare
2016-08-30 17:32:46 +00:00
- tests
2016-12-16 05:51:40 +00:00
- post-test
2022-02-04 15:30:44 +00:00
- update-cache
2021-05-22 07:21:44 +00:00
- package
- image
2018-03-27 12:34:12 +00:00
- scan-dependencies
2018-04-10 12:30:44 +00:00
- staging_upload
2018-12-18 07:10:38 +00:00
- package-and-image-release
2023-02-10 05:35:15 +00:00
- qa-release
2018-06-25 15:29:26 +00:00
- validate
2018-04-10 12:30:44 +00:00
- metrics
2019-04-04 17:26:00 +00:00
- aws-marketplace-release
2017-08-07 11:20:03 +00:00
- notification_fail
2024-04-08 22:24:30 +00:00
- qa
2022-07-27 21:12:24 +00:00
- verify
2016-06-03 11:17:40 +00:00
2022-08-05 19:41:13 +00:00
include :
- local : '/gitlab-ci-config/workflow-rules.yml'
- local : '/gitlab-ci-config/dev-gitlab-org.yml'
- local : '/gitlab-ci-config/gitlab-com.yml'
rules :
2022-08-16 22:45:11 +00:00
- if : '$CI_SERVER_HOST == "gitlab.com"'
2020-04-06 16:26:44 +00:00
default :
tags :
- gitlab-org
2017-06-07 08:10:53 +00:00
variables :
2020-07-28 15:18:49 +00:00
# BUILDER_IMAGE_REGISTRY is set to
# `dev.gitlab.org:5005/cookbooks/gitlab-omnibus-builder` in the project
# settings of omnibus-gitlab mirror in dev.gitlab.org so that builds there
# will use images from that registry and not depend on GitLab.com
2021-02-17 22:22:35 +00:00
BUILDER_IMAGE_REGISTRY : "registry.gitlab.com/gitlab-org/gitlab-omnibus-builder"
2023-04-07 19:14:20 +00:00
# To be used for images that exist only on dev.gitlab.org
DEV_BUILDER_IMAGE_REGISTRY : 'dev.gitlab.org:5005/cookbooks/gitlab-omnibus-builder'
2021-02-17 22:22:35 +00:00
PUBLIC_BUILDER_IMAGE_REGISTRY : "registry.gitlab.com/gitlab-org/gitlab-omnibus-builder"
2024-04-23 16:56:24 +00:00
BUILDER_IMAGE_REVISION : "5.12.0"
2018-11-13 19:41:22 +00:00
# The registry to pull the assets image from
ASSET_REGISTRY : "${CI_REGISTRY}"
ASSET_SYNC_EXISTING_REMOTE_FILES : "keep"
ASSET_SYNC_GZIP_COMPRESSION : "true"
ASSET_PATH : "assets-${CI_COMMIT_REF_SLUG}"
2020-04-30 08:02:33 +00:00
COMPILE_ASSETS : "false"
2023-04-03 16:42:38 +00:00
RUBY_IMAGE : "ruby:3.0"
2019-07-12 09:02:42 +00:00
BUNDLE_PATH__SYSTEM : "false"
2019-05-01 20:53:34 +00:00
# Format of the auto-deploy tag for auto-deploy builds.
# https://gitlab.com/gitlab-org/release/docs/blob/master/general/deploy/auto-deploy.md#auto-deploy-tagging
AUTO_DEPLOY_TAG_REGEX : '^\d+\.\d+\.\d+\+[^ ]{7,}\.[^ ]{7,}$'
# Default environment for auto-deploy
AUTO_DEPLOY_ENVIRONMENT : 'pre'
2020-06-17 05:32:27 +00:00
OMNIBUS_GITLAB_MIRROR_ID : "14588374"
2021-03-17 15:38:24 +00:00
DOCS_GITLAB_REPO_SUFFIX : "omnibus"
2023-06-08 12:29:30 +00:00
CACHE_KEY_SUFFIX : '-v3'
2021-08-04 05:34:05 +00:00
CACHE_EDITION : "CE"
2024-04-02 04:24:21 +00:00
CACHE_POLICY : 'pull-push'
2022-04-05 18:19:19 +00:00
ISSUE_BOT_LABELS_EXTRA : "group::distribution"
2024-04-30 22:46:18 +00:00
BUNDLER_VERSION : "2.5.9"
2023-03-16 20:50:25 +00:00
# NOTE: When `NEXT_RUBY_VERSION` is updated, flip
# `USE_NEXT_RUBY_VERSION_IN_*` variables to false to avoid surprises.
2023-11-16 10:55:46 +00:00
NEXT_RUBY_VERSION : "3.1.4"
2024-02-28 04:33:29 +00:00
GET_GEO_TAG : "0.7.4"
2023-01-24 23:05:35 +00:00
CANONICAL_PROJECT_PATH : 'gitlab-org/omnibus-gitlab'
SECURITY_PROJECT_PATH : 'gitlab-org/security/omnibus-gitlab'
DEV_PROJECT_PATH : 'gitlab/omnibus-gitlab'
QA_PROJECT_PATH : 'gitlab-org/build/omnibus-gitlab-mirror'
2023-10-24 21:05:45 +00:00
ARM64_RUNNER_TAG : 'arm64'
2023-12-01 05:27:58 +00:00
PACKAGE_PROMOTION_RUNNER_TAG : 'promotion'
2024-02-26 15:43:08 +00:00
NIGHTLY_REPO : 'nightly-builds'
NIGHTLY_FIPS_REPO : 'nightly-fips-builds'
2017-06-07 08:10:53 +00:00
2023-08-08 02:48:35 +00:00
.distribution-amd64-tags :
- distribution-runner
- amd64
.distribution-arm64-tags :
- distribution-runner
2023-10-24 21:05:45 +00:00
- ${ARM64_RUNNER_TAG}
2023-08-08 02:48:35 +00:00
.distribution-armhf-tags :
- distribution-runner
- armhf
2018-11-13 19:41:22 +00:00
### For services that need a docker daemon
.docker_job : &docker_job
2023-08-15 02:32:01 +00:00
image : "${BUILDER_IMAGE_REGISTRY}/distribution_ci_tools:${BUILDER_IMAGE_REVISION}"
2018-11-13 19:41:22 +00:00
variables :
2019-03-23 04:47:10 +00:00
DOCKER_DRIVER : overlay2
2018-11-13 19:41:22 +00:00
DOCKER_HOST : tcp://docker:2375
services :
2023-05-08 09:27:39 +00:00
- name : docker:23.0.5-dind
2021-05-18 15:32:29 +00:00
alias : localhost
2018-11-13 19:41:22 +00:00
tags :
2020-04-06 16:26:44 +00:00
- gitlab-org-docker
2018-11-13 19:41:22 +00:00
2022-09-11 06:49:24 +00:00
.gems-cache :
cache :
key : "gems-cache-${BUILDER_IMAGE_REVISION}${CACHE_KEY_SUFFIX}"
paths :
- gems
policy : pull
2023-04-04 19:32:24 +00:00
.gems-cache-os-dependent :
cache :
key : "gems-cache-${CI_JOB_IMAGE}${CACHE_KEY_SUFFIX}"
paths :
- gems
2023-09-07 06:21:02 +00:00
.build-package : &build-package
- bundle exec rake cache:populate
- bundle exec rake cache:restore
- bundle exec rake build:project
- bundle exec rake build:package:sync
- bundle exec rake cache:bundle
- bundle exec rake build:component_shas
2017-06-27 16:00:36 +00:00
before_script :
2022-08-05 19:41:13 +00:00
- echo "PIPELINE_TYPE detected as ${PIPELINE_TYPE}"
2023-03-29 19:05:18 +00:00
# Exit early if building on an OS for which we don't provide the specified
# package edition (CE/EE). For child pipelines from
# TRIGGERED_(CE|EE)_PIPELINE, we don't want exit early, but try to build
# everything.
- if [[ "${CI_PIPELINE_SOURCE}" != "parent_pipeline" ]]; then
export CE_ONLY=(Raspberry);
export EE_ONLY=(SLES RAT);
for job in "${CE_ONLY[@]}"; do
if [[ "${CI_JOB_NAME}" =~ ${job} ]]; then
if ./support/is_gitlab_ee.sh; then
echo "EE build found. ${CI_JOB_NAME} is run only on CE builds";
exit 0 ;
fi;
2018-12-17 06:18:33 +00:00
fi;
2023-03-29 19:05:18 +00:00
done;
for job in "${EE_ONLY[@]}"; do
if [[ "${CI_JOB_NAME}" =~ ${job} ]]; then
if ! ./support/is_gitlab_ee.sh; then
echo "CE build found. ${CI_JOB_NAME} is run only on EE builds";
exit 0 ;
fi;
2018-12-17 06:18:33 +00:00
fi;
2023-03-29 19:05:18 +00:00
done
fi
2017-06-27 16:00:36 +00:00
- echo $NIGHTLY
- mkdir -p ~/.ssh
- mkdir -p ~/.aws
- mkdir -p cache
2019-06-19 16:13:02 +00:00
- if [ -n "$DEV_GITLAB_SSH_KEY" ]; then
echo "$DEV_GITLAB_SSH_KEY" > ~/.ssh/id_rsa;
cp support/known_hosts ~/.ssh/known_hosts;
chmod -R 0600 ~/.ssh/;
fi
2022-07-27 21:12:24 +00:00
- bash scripts/ci/prepare_bundle.sh
2024-02-26 15:43:08 +00:00
- if [ -n "$NIGHTLY" ]; then
export STAGING_REPO=${NIGHTLY_REPO};
export FIPS_STAGING_REPO=${NIGHTLY_FIPS_REPO};
fi
2017-06-27 16:00:36 +00:00
2018-11-13 19:41:22 +00:00
fetch-assets :
2018-12-13 11:31:45 +00:00
extends : .docker_job
2022-02-01 04:54:02 +00:00
stage : prepare
2021-03-11 08:38:57 +00:00
timeout : 1 hour
2021-06-29 12:32:12 +00:00
before_script : [ ]
2018-11-13 19:41:22 +00:00
script :
2022-10-12 21:52:50 +00:00
- export VERSION=${GITLAB_ASSETS_TAG-${GITLAB_REF_SLUG-$(ruby -I. -e 'require "lib/gitlab/version"; puts Gitlab::Version.new("gitlab-rails").print')}}
2018-11-19 18:15:13 +00:00
- support/fetch_assets "${VERSION}"
2018-11-13 19:41:22 +00:00
artifacts :
paths :
- ${ASSET_PATH}
2020-08-24 18:56:12 +00:00
rules :
- if : '$COMPILE_ASSETS == "true"'
when : never
2020-11-17 20:32:04 +00:00
# NOTE (rspeicher): Checking `$AUTO_DEPLOY_COMPILE_ASSETS` as a feature flag
# See https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/5805
2022-08-22 20:15:22 +00:00
- if : '$AUTO_DEPLOY_COMPILE_ASSETS && $PIPELINE_TYPE =~ /AUTO_DEPLOY_BUILD_PIPELINE$/'
2020-08-24 18:56:12 +00:00
when : never
2022-08-22 20:15:22 +00:00
# Run on all pipelines including a package build (except auto-deploy tag
# covered above)
- if : '$PIPELINE_TYPE =~ /_BUILD_PIPELINE$/'
- if : '$PIPELINE_TYPE =~ /TRIGGERED_(CE|EE)_PIPELINE/'
- if : '$PIPELINE_TYPE == "TRIGGER_CACHE_UPDATE_PIPELINE"'
- if : '$PIPELINE_TYPE == "DURATION_PLOTTER_PIPELINE"'
2024-03-05 17:42:42 +00:00
retry : 2
2020-11-17 20:32:04 +00:00
2021-06-29 12:32:12 +00:00
generate-facts :
2022-09-11 06:49:24 +00:00
extends : .gems-cache
2022-02-01 04:54:02 +00:00
stage : prepare
2023-08-15 02:32:01 +00:00
image : "${BUILDER_IMAGE_REGISTRY}/distribution_ci_tools:${BUILDER_IMAGE_REVISION}"
2021-06-29 12:32:12 +00:00
script :
2022-11-11 00:46:06 +00:00
- mkdir -p build_facts
2023-06-16 22:35:16 +00:00
- bundle exec omnibus manifest gitlab -l nothing > build_facts/version-manifest.json
2021-06-29 12:32:12 +00:00
- bundle exec rake build:generate_facts
artifacts :
paths :
- build_facts
2022-01-27 20:20:22 +00:00
reports :
dotenv : build_facts/env_vars
2021-06-29 12:32:12 +00:00
rules :
2022-09-11 09:05:30 +00:00
- if : '$PIPELINE_TYPE =~ /_BUILD_PIPELINE$/'
2022-08-05 19:41:13 +00:00
- if : '$PIPELINE_TYPE == "TRIGGER_CACHE_UPDATE_PIPELINE"'
2023-02-02 15:29:53 +00:00
- if : '$PIPELINE_TYPE =~ /_TEST_PIPELINE$/'
2022-08-05 19:41:13 +00:00
- if : '$PIPELINE_TYPE == "GITLAB_MR_PIPELINE"'
- if : '$PIPELINE_TYPE =~ /TRIGGERED_(CE|EE)_PIPELINE/'
2022-10-11 13:08:37 +00:00
- if : '$PIPELINE_TYPE == "DEPS_IO_VERSION_BUMP_PIPELINE"'
2022-11-11 00:46:06 +00:00
- if : '$PIPELINE_TYPE == "DEPENDENCY_SCANNING_PIPELINE"'
2023-01-11 06:55:32 +00:00
- if : '$PIPELINE_TYPE == "FORK_MR_PIPELINE"'
2022-08-05 19:41:13 +00:00
- when : never
2022-03-03 19:59:13 +00:00
needs : [ ]
2024-03-05 17:42:42 +00:00
retry : 2
2021-06-29 12:32:12 +00:00
2020-01-02 04:00:18 +00:00
.notify :
2017-06-27 16:00:36 +00:00
before_script :
2020-10-15 20:55:03 +00:00
- apk add --no-cache curl
2016-07-22 14:24:02 +00:00
image : "alpine"
2016-06-03 11:17:40 +00:00
stage : notification_fail
2020-01-02 04:00:18 +00:00
notify:slack-fail:scheduled-master :
extends :
- .notify
script :
- ./support/notify_slack.sh "#qa-master" "☠️ Scheduled omnibus-build against master failed! ☠️ See $CI_PIPELINE_URL (triggered from $TOP_UPSTREAM_SOURCE_JOB)"
2023-01-09 17:27:18 +00:00
rules :
- if : '$TOP_UPSTREAM_SOURCE_JOB == null || $TOP_UPSTREAM_SOURCE_REF != "master"'
when : never
- if : '$PIPELINE_TYPE == "TRIGGERED_EE_PIPELINE"'
when : on_failure
2021-09-10 17:50:26 +00:00
issue-bot :
stage : notification_fail
image : registry.gitlab.com/gitlab-org/distribution/issue-bot:latest
script : /issue-bot
rules :
2023-01-09 17:27:18 +00:00
- if : '$CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH'
when : never
- if : '$PIPELINE_TYPE == "PROTECTED_TEST_PIPELINE"'
2021-09-10 17:50:26 +00:00
when : on_failure