.gitlab-ci.yml 896 Bytes
Newer Older
Tobias Weiss's avatar
Tobias Weiss committed
1
2
3
4
5
6
7
variables:
  IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
  RELEASE_TAG: $CI_REGISTRY_IMAGE:latest
  DOCKER_GIT_IMAGE: registry.itgit.zib.de:5005/pub/docker-git

stages:
  - build
Tobias Weiss's avatar
Tobias Weiss committed
8
  - testing
Tobias Weiss's avatar
Tobias Weiss committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  - 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: $DOCKER_GIT_IMAGE
  before_script:
    - *prepare_docker

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

Tobias Weiss's avatar
Tobias Weiss committed
26
schlafen:
Tobias Weiss's avatar
Tobias Weiss committed
27
  stage: testing
Tobias Weiss's avatar
Tobias Weiss committed
28
29

  script:
Tobias Weiss's avatar
Tobias Weiss committed
30
    - slafsep 10
Tobias Weiss's avatar
Tobias Weiss committed
31
32

weiter_schlafen:
Tobias Weiss's avatar
Tobias Weiss committed
33
  stage: testing
Tobias Weiss's avatar
Tobias Weiss committed
34
35
36

  script:
    - sleep 10
Tobias Weiss's avatar
Tobias Weiss committed
37
38


Tobias Weiss's avatar
Tobias Weiss committed
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
release_docker_image:
  stage: release
  
  image: $DOCKER_GIT_IMAGE
  before_script:
    - *prepare_docker

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

  only:
    - master