Skip to content
Snippets Groups Projects
dev-gitlab-org.yml 35.41 KiB
# This config lists the jobs that will be run on omnibus-gitlab project in
# dev.gitlab.org.

#############
# Templates #
#############

.default_rules:
  rules:
    - if: '$SKIP_JOB_REGEX && $CI_JOB_NAME =~ $SKIP_JOB_REGEX'
      when: never

.skip_release_jobs:
  rules:
    - if: '$SKIP_RELEASE == "true"'
      when: never

.package-artifacts: &package-artifacts
  when: always
  expire_in: 1 day
  paths:
    - pkg/

.package-artifacts-release:
  <<: *package-artifacts
  expire_in: 7 days

.cache-paths:
  - cache
  - gems
  - assets_cache
  - node_modules

.branch-cache:
  key: "${CI_JOB_NAME}-${BUILDER_IMAGE_REVISION}-${CACHE_EDITION}${CACHE_KEY_SUFFIX}"
  paths: !reference [.cache-paths]
  policy: $CACHE_POLICY

.tag-cache:
  # Use the same cache key as branch builds, by manually appending `-branch` substring.
  key: "${CI_JOB_NAME}-branch-${BUILDER_IMAGE_REVISION}-${CACHE_EDITION}${CACHE_KEY_SUFFIX}"
  paths: !reference [.cache-paths]
  policy: $CACHE_POLICY

.branch_template:
  stage: package
  script:
    - support/import_gpg_secrets.sh
    - !reference [.build-package]
    # Run package size checks on nightlies. The job will create alerts, so we
    # don't need it to fail and block the pipeline. Hence the `|| true`.
    - if [ -n "$NIGHTLY" ]; then
      bundle exec rake check:package_size || true;
      fi
  tags: !reference [.distribution-amd64-tags]
  artifacts: !reference [.package-artifacts]
  needs:
    - job: fetch-assets
      optional: true
    - job: generate-facts
      optional: true
      artifacts: true
  cache: !reference [.branch-cache]
  retry: 1
  rules:
    - !reference [.default_rules, rules]
    - if: '$PIPELINE_TYPE =~ /_(NIGHTLY|BRANCH)_BUILD_PIPELINE$/'
    # Include it in TRIGGER_CACHE_UPDATE_PIPELINE pipeline cache used by
    # nightlies and triggered builds are refreshed periodically
    - if: '$PIPELINE_TYPE == "TRIGGER_CACHE_UPDATE_PIPELINE"'