Build.gitlab-ci.yml 1.02 KB
Newer Older
1 2
build:
  stage: build
3
  image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-build-image:v0.4.0"
4 5
  variables:
    DOCKER_TLS_CERTDIR: ""
6
  services:
7
    - docker:19.03.12-dind
8
  script:
9 10 11 12 13 14 15 16
    - |
      if [[ -z "$CI_COMMIT_TAG" ]]; then
        export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG}
        export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_SHA}
      else
        export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE}
        export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_TAG}
      fi
17
    - /build/build.sh
18
  rules:
19 20
    - if: '$AUTO_DEVOPS_PLATFORM_TARGET == "EC2"'
      when: never
21
    - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
22 23 24 25 26 27 28 29

build_artifact:
  stage: build
  script:
    - 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"
    - exit 1
  rules:
    - if: '$AUTO_DEVOPS_PLATFORM_TARGET == "EC2"'