-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
147 lines (137 loc) · 4.92 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
stages:
- source-tests
- build-containers
- packaging
- functional-tests
variables:
DOCKER_DRIVER: overlay2
DOCKER_FILES_URL: docker.greenhost.net/open/stapled
BUILD_COMPILE_CONTAINER: $DOCKER_FILES_URL/build-buster
STRETCH_TEST_CONTAINER: $DOCKER_FILES_URL/test-stretch
BUSTER_TEST_CONTAINER: $DOCKER_FILES_URL/test-buster
# GL bug causes recursive strategy to fail for LE certificates
# GH recently started using LE certificates:
# https://gitlab.com/gitlab-org/gitlab-runner/issues/2148
# Adding old fashion before_script below.
# GIT_SUBMODULE_STRATEGY: recursive
build:compile-container:
image: docker:stable-git
services:
#- docker:stable-dind
- docker:18-dind # Hotfix for https://gitlab.com/gitlab-org/gitlab-runner/issues/4501
stage: build-containers
variables:
GIT_STRATEGY: fetch
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN docker.greenhost.net
- docker pull $BUILD_COMPILE_CONTAINER || true
- docker build --cache-from $CONTAINER_IMAGE:latest --pull --cache-from $BUILD_COMPILE_CONTAINER:latest -t $BUILD_COMPILE_CONTAINER:$CI_BUILD_REF -t $BUILD_COMPILE_CONTAINER:latest -f ./docker/build-stretch/Dockerfile ./
- docker push $BUILD_COMPILE_CONTAINER:$CI_BUILD_REF
- docker push $BUILD_COMPILE_CONTAINER:latest
build:test-container-stretch:
stage: build-containers
image: docker:stable-git
services:
#- docker:stable-dind
- docker:18-dind # Hotfix for https://gitlab.com/gitlab-org/gitlab-runner/issues/4501
variables:
GIT_STRATEGY: fetch
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN docker.greenhost.net
- docker pull $STRETCH_TEST_CONTAINER || true
- docker build --cache-from $CONTAINER_IMAGE:latest --pull --cache-from $STRETCH_TEST_CONTAINER:latest -t $STRETCH_TEST_CONTAINER:$CI_BUILD_REF -t $STRETCH_TEST_CONTAINER:latest -f ./docker/test-stretch/Dockerfile ./
- docker push $STRETCH_TEST_CONTAINER:$CI_BUILD_REF
- docker push $STRETCH_TEST_CONTAINER:latest
build:test-container-buster:
stage: build-containers
image: docker:stable-git
services:
#- docker:stable-dind
- docker:18-dind # Hotfix for https://gitlab.com/gitlab-org/gitlab-runner/issues/4501
variables:
GIT_STRATEGY: fetch
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN docker.greenhost.net
- docker pull $BUSTER_TEST_CONTAINER || true
- docker build --cache-from $CONTAINER_IMAGE:latest --pull --cache-from $BUSTER_TEST_CONTAINER:latest -t $BUSTER_TEST_CONTAINER:$CI_BUILD_REF -t $BUSTER_TEST_CONTAINER:latest -f ./docker/test-buster/Dockerfile ./
- docker push $BUSTER_TEST_CONTAINER:$CI_BUILD_REF
- docker push $BUSTER_TEST_CONTAINER:latest
build:package:
stage: packaging
image: $BUILD_COMPILE_CONTAINER
script:
- git submodule sync --recursive
- git submodule update --init --recursive
- which python3 && $(which python3) --version
- openssl version
# Hack to get python-daemon to install..
- pip3 install --user docutils==0.15.2
- pip3 install --user -r requirements.txt
- make clean
- make
artifacts:
paths:
- dist/stapled*.tar.gz
- dist/stapled*.rpm
- dist/stapled*.whl
- dist/stapled*.tar.bz2
- dist/stapled*.deb
source:unit-stretch:
stage: source-tests
image: python:3.5-stretch
script:
- git submodule sync --recursive
- git submodule update --init --recursive
- which python3 && $(which python3) --version
# Hack to get python-daemon to install..
- pip3 install --user docutils==0.15.2
- pip3 install -r requirements.txt
- pytest -v
source:unit-buster:
stage: source-tests
image: python:3.7-buster
script:
- git submodule sync --recursive
- git submodule update --init --recursive
- which python3 && $(which python3) --version
# Hack to get python-daemon to install..
- pip3 install --user docutils==0.15.2
- pip3 install -r requirements.txt
- pytest -v
test:stretch:
stage: functional-tests
image: $STRETCH_TEST_CONTAINER
variables:
GIT_STRATEGY: none
script:
- which python3 && $(which python3) --version
- openssl version
- apt-get install -y -q ./dist/stapled_*all.deb
- /refresh_testdata.sh
- stapled -p /tmp/testdata/ --recursive --interactive --no-haproxy-sockets -vvvv --one-off
dependencies:
- build:package
test:buster:
stage: functional-tests
image: $BUSTER_TEST_CONTAINER
variables:
GIT_STRATEGY: none
script:
- which python3 && $(which python3) --version
- openssl version
- apt-get install -y -q ./dist/stapled_*all.deb
- /refresh_testdata.sh
- stapled -p /tmp/testdata/ --recursive --interactive --no-haproxy-sockets -vvvv --one-off
dependencies:
- build:package
source:dev-setup:
stage: source-tests
image: python:3.7-buster
script:
- git submodule sync --recursive
- git submodule update --init --recursive
- which python3 && $(which python3) --version
- openssl version
- pip3 install -e .
- ./refresh_testdata.sh
- stapled -p /tmp/testdata/ --recursive --interactive --no-haproxy-sockets -vvvv --one-off