-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
57 lines (49 loc) · 1.71 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
56
stages:
- build
- publish
variables:
GIT_STRATEGY: clone
# This import is for the func_rse_docker_* functions
before_script:
- curl https://code.ornl.gov/rse-deployment/rse-sharables/raw/master/rse-bash-modules.sh -O
- source rse-bash-modules.sh
- func_rse_docker_cleanup
after_script:
- curl https://code.ornl.gov/rse-deployment/rse-sharables/raw/master/rse-bash-modules.sh -O
- source rse-bash-modules.sh
- func_rse_docker_cleanup
- sudo chown -R gitlab-runner .
lint:
stage: build
script:
- docker login --username=$CI_REGISTRY_USER --password=$CI_REGISTRY_PASSWORD $CI_REGISTRY
- make docker-lint
tags:
- rse-multi-builder
test:
stage: build
script:
- docker login --username=$CI_REGISTRY_USER --password=$CI_REGISTRY_PASSWORD $CI_REGISTRY
- make docker-test
tags:
- rse-multi-builder
coverage:
stage: build
script:
- docker login --username=$CI_REGISTRY_USER --password=$CI_REGISTRY_PASSWORD $CI_REGISTRY
- make docker-coverage
tags:
- rse-multi-builder
publish:
stage: publish
script:
- docker login --username=$CI_REGISTRY_USER --password=$CI_REGISTRY_PASSWORD $CI_REGISTRY
- >
docker build
-f dockerfiles/production.Dockerfile
-t ${CI_REGISTRY_IMAGE}/${CI_COMMIT_REF_SLUG}:${CI_COMMIT_SHORT_SHA} .
- docker tag ${CI_REGISTRY_IMAGE}/${CI_COMMIT_REF_SLUG}:${CI_COMMIT_SHORT_SHA} ${CI_REGISTRY_IMAGE}/${CI_COMMIT_REF_SLUG}:latest
- docker push ${CI_REGISTRY_IMAGE}/${CI_COMMIT_REF_SLUG}:${CI_COMMIT_SHORT_SHA}
- docker push ${CI_REGISTRY_IMAGE}/${CI_COMMIT_REF_SLUG}:latest
tags:
- rse-multi-builder