forked from empa-scientific-it/openbis-uploader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
executable file
·55 lines (45 loc) · 1.2 KB
/
.gitlab-ci.yml
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
stages:
- docker
- test
- build
- deploy
- cleanup
variables:
CI_REGISTRY_IMAGE: localhost:5000/registry
before_script:
- docker info
build-data-discovery:
stage: docker
image: docker:latest
services:
- docker:dind
tags:
- dind
# before_script:
# - echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE"/data-discovery:latest ./services/data-discovery/
- docker push "$CI_REGISTRY_IMAGE"/data-discovery:latest
only:
changes:
- services/data-discovery/Dockerfile
- services/data-discovery/requirements.txt
test-data-discovery:
stage: test
image: alpine/curl:latest
before_script:
- echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
services:
- name: $CI_REGISTRY_IMAGE/data-discovery:latest
alias: data-discovery
script:
- curl data-discovery:8000/
needs: ["build-data-discovery"]
only:
changes:
- services/data-discovery/Dockerfile
- services/data-discovery/requirements.txt
stop_registry:
stage: cleanup
when: on_failure
script: docker stop registry