.gitlab-ci.yml 884 Bytes
Newer Older
Amine  GHOZLANE's avatar
Amine GHOZLANE committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
stages:
  - build

build_dev:
  image: docker:latest
  stage: build
  variables:
    CI_DEBUG_TRACE: "false"
  script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
    - docker build
      --build-arg CI_COMMIT_REF_SLUG
      --build-arg CI_COMMIT_SHA
      --build-arg CI_COMMIT_SHORT_SHA
      --cache-from "$CI_REGISTRY_IMAGE:latest"
      --cache-from "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
      --tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
      --tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"
      --tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
      .
    - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
    - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"
    - docker login -u "$DOCKER_USER" -p "$DOCKER_PASS"
    - docker push -t aghozlane/shaman