-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
45 lines (37 loc) · 1.05 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:stable
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
CONTAINER_TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest
services:
- name: docker:dind
command: ["--insecure-registry=git.ropod.org:4567"] # self-signed cetificate
stages:
- build
- test
- release
before_script:
- docker info
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN git.ropod.org:4567
- echo $CONTAINER_TEST_IMAGE
- echo $CONTAINER_RELEASE_IMAGE
build:
stage: build
script:
- docker build --pull -t $CONTAINER_TEST_IMAGE .
- docker push $CONTAINER_TEST_IMAGE
test:
stage: test
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker run $CONTAINER_TEST_IMAGE bash -c "cd /opt/ropod/ropod_common/ && mkdir build && cd build && cmake .. && make"
release-image:
stage: release
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
- docker push $CONTAINER_RELEASE_IMAGE
only:
- master
- tags