-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
45 lines (39 loc) · 1.28 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
image: docker:latest
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
ARTIFACTORY_URL: "artifactory.tools.in.pan-net.eu"
ARTIFACTORY_REGISTRY: "net_mon-images-docker-local"
ARTIFACTORY_LOGIN: "f540422"
cache:
paths:
- .cache/pip
before_script:
- apk add --no-cache curl py-pip python3-dev libffi-dev openssl-dev gcc libc-dev make
- pip3 install docker-compose
stages:
- test
- push_docker
test:
stage: test
script:
- docker-compose -f docker-compose-test.yml down -v
- docker-compose -f docker-compose-test.yml build
- docker-compose -f docker-compose-test.yml up --exit-code-from tests --abort-on-container-exit
after_script:
- docker-compose -f docker-compose-test.yml down -v
only:
- tags
build_push_docker_image_tagged:
stage: push_docker
tags:
- docker-build
environment:
name: $CI_COMMIT_REF_NAME
script:
- docker-compose -f docker-compose.yml build
- export
- docker login -u ${ARTIFACTORY_LOGIN} -p ${ARTIFACTORY_TOKEN} https://${ARTIFACTORY_URL}
- docker tag kafka-go-streamer:latest ${ARTIFACTORY_URL}/${ARTIFACTORY_REGISTRY}/docker-images/${CI_PROJECT_NAME}:$CI_COMMIT_TAG
- docker push ${ARTIFACTORY_URL}/${ARTIFACTORY_REGISTRY}/docker-images/${CI_PROJECT_NAME}:$CI_COMMIT_TAG
only:
- tags