1# WARNING: This latest template is for internal FEATURE-FLAG TESTING ONLY.
2#          It is not meant to be used with `include:`.
3#          This template is scheduled for removal when testing is complete: https://gitlab.com/gitlab-org/gitlab/-/issues/337987
4
5variables:
6  AUTO_BUILD_IMAGE_VERSION: 'v1.5.0'
7
8build:
9  stage: build
10  image: 'registry.gitlab.com/gitlab-org/cluster-integration/auto-build-image:${AUTO_BUILD_IMAGE_VERSION}'
11  variables:
12    DOCKER_TLS_CERTDIR: ''
13  services:
14    - name: 'docker:20.10.6-dind'
15      command: ['--tls=false', '--host=tcp://0.0.0.0:2375']
16  script:
17    - |
18      if [[ -z "$CI_COMMIT_TAG" ]]; then
19        export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG}
20        export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_SHA}
21      else
22        export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE}
23        export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_TAG}
24      fi
25    - /build/build.sh
26  artifacts:
27    reports:
28      dotenv: gl-auto-build-variables.env
29  rules:
30    - if: '$BUILD_DISABLED'
31      when: never
32    - if: '$AUTO_DEVOPS_PLATFORM_TARGET == "EC2"'
33      when: never
34    - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
35
36build_artifact:
37  stage: build
38  script:
39    - printf "To build your project, please create a build_artifact job into your .gitlab-ci.yml file.\nMore information at https://docs.gitlab.com/ee/ci/cloud_deployment\n"
40    - exit 1
41  rules:
42    - if: '$BUILD_DISABLED'
43      when: never
44    - if: '$AUTO_DEVOPS_PLATFORM_TARGET == "EC2"'
45