.gitlab-ci.yml 778 Bytes
Newer Older
1
2
variables:
  IMAGE_TAG: $CI_REGISTRY_IMAGE/jupyter:$CI_COMMIT_REF_NAME
3
  RELEASE_TAG: $CI_REGISTRY_IMAGE/scipoptsuite:20200731
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
  BUILD_IMAGE: $CI_REGISTRY_IMAGE/docker-git

stages:
  - build
  - release


.prepare_docker:
  before_script: &prepare_docker |
    docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY


build_docker_image:
  stage: build

  image: $BUILD_IMAGE

  before_script:
    - *prepare_docker

  script:
    - docker build -t $IMAGE_TAG .
    - docker push $IMAGE_TAG


release_docker_image:
  stage: release

  image: $BUILD_IMAGE

  before_script:
    - *prepare_docker

  script:
    - docker pull $IMAGE_TAG
    - docker tag $IMAGE_TAG $RELEASE_TAG
    - docker push $RELEASE_TAG

  dependencies:
    - build_docker_image

  only:
    - master