.gitlab-ci.yml 3.21 KB
Newer Older
Adrien Dorsaz's avatar
Adrien Dorsaz committed
1
2
3
4
###
### Pipeline(s) definition (stages and "only" keys)
###

5
stages:
6
  - build
7
  - check
8
  - unit_test
9
10
  - lets_encrypt_staging

11
12
13
14
15
.build:
  stage: build
  only:
    - merge_requests
    - master
16

17
18
19
20
21
22
.check:
  stage: check
  only:
    - merge_requests
    - master

23
24
.unit_test:
  stage: unit_test
25
26
27
  only:
    - merge_requests
    - master
28

29
30
31
32
33
34
.lets_encrypt_staging:
  stage: lets_encrypt_staging
  only:
    - merge_requests
    - master

Adrien Dorsaz's avatar
Adrien Dorsaz committed
35
36
37
38
39
###
### Stage: build
###

.build-common:
40
  extends: .build
Adrien Dorsaz's avatar
Adrien Dorsaz committed
41
42
43
44
45
46
47
  image: docker:stable
  variables:
    DOCKER_DRIVER: overlay2
    DOCKER_BUILDKIT: 1

jessie-slim:
  extends: .build-common
48
  script:
49
50
51
52
  - docker build
    --progress plain
    -t "acme-dns-tiny:jessie-slim"
    -f "docker/jessie/Dockerfile" .
53
54

stretch-slim:
Adrien Dorsaz's avatar
Adrien Dorsaz committed
55
  extends: .build-common
56
  script:
57
58
59
60
  - docker build 
    --progress plain
    -t "acme-dns-tiny:stretch-slim"
    -f "docker/stretch/Dockerfile" .
61
62

buster-slim:
Adrien Dorsaz's avatar
Adrien Dorsaz committed
63
  extends: .build-common
64
  script:
65
66
67
68
  - docker build
    --progress plain
    -t "acme-dns-tiny:buster-slim"
    -f "docker/buster/Dockerfile" .
69

Adrien Dorsaz's avatar
Adrien Dorsaz committed
70
71
72
73
74
###
### Stage: check
###

.check-common:
75
  extends: .check
Adrien Dorsaz's avatar
Adrien Dorsaz committed
76
77
78
79
  image: acme-dns-tiny:buster-slim

compile:
  extends: .check-common
80
81
82
83
  script:
    - python3 -m py_compile acme_dns_tiny.py tools/*.py tests/*.py

lint:
Adrien Dorsaz's avatar
Adrien Dorsaz committed
84
  extends: .check-common
85
  script:
86
87
88
89
90
91
92
93
    - pylint3 --max-line-length=99 acme_dns_tiny.py
    - pylint3 --max-line-length=99 tools/acme_account_deactivate.py
    - pylint3 --max-line-length=99 tools/acme_account_rollover.py
    - pylint3 --max-line-length=99 tests/config_factory.py
    - pylint3 --max-line-length=99 tests/staging_test_acme_dns_tiny.py
    - pylint3 --max-line-length=99 tests/unit_test_acme_dns_tiny.py
    - pylint3 --max-line-length=99 tests/staging_test_acme_account_deactivate.py
    - pylint3 --max-line-length=99 tests/staging_test_acme_account_rollover.py
94

Adrien Dorsaz's avatar
Adrien Dorsaz committed
95
pep8:
Adrien Dorsaz's avatar
Adrien Dorsaz committed
96
  extends: .check-common
Adrien Dorsaz's avatar
Adrien Dorsaz committed
97
  script:
98
99
    - pycodestyle --max-line-length=99 --ignore=E401,W503 --exclude=tests .
    - pycodestyle --max-line-length=99 --ignore=E722 tests
Adrien Dorsaz's avatar
Adrien Dorsaz committed
100

Adrien Dorsaz's avatar
Adrien Dorsaz committed
101
102
103
104
105
###
### Stage: unit_test
###

.unit_test-common:
106
  extends: .unit_test
Adrien Dorsaz's avatar
Adrien Dorsaz committed
107
108
109
110
111
112
  script:
    - python3-coverage run --append --source ./ -m unittest -v
      tests.unit_test_acme_dns_tiny

jessie-ut:
  extends: .unit_test-common
113
  image: acme-dns-tiny:jessie-slim
114

115
stretch-ut:
Adrien Dorsaz's avatar
Adrien Dorsaz committed
116
  extends: .unit_test-common
117
  image: acme-dns-tiny:stretch-slim
118

119
buster-ut:
Adrien Dorsaz's avatar
Adrien Dorsaz committed
120
  extends: .unit_test-common
121
  image: acme-dns-tiny:buster-slim
122
123
124
  artifacts:
    paths:
      - .coverage
125

Adrien Dorsaz's avatar
Adrien Dorsaz committed
126
127
128
129
130
###
### Stage: lets_encrypt_staging
###

.lets_encrypt_staging-common:
131
  extends: .lets_encrypt_staging
Adrien Dorsaz's avatar
Adrien Dorsaz committed
132
133
134
135
136
137
138
139
  script:
    - python3-coverage run --append --source ./ -m unittest -v
      tests.staging_test_acme_dns_tiny
      tests.staging_test_acme_account_rollover
      tests.staging_test_acme_account_deactivate

jessie-le-staging:
  extends: .lets_encrypt_staging-common
140
  image: acme-dns-tiny:jessie-slim
141

142
stretch-le-staging:
Adrien Dorsaz's avatar
Adrien Dorsaz committed
143
  extends: .lets_encrypt_staging-common
144
  image: acme-dns-tiny:stretch-slim
145

146
buster-le-staging:
Adrien Dorsaz's avatar
Adrien Dorsaz committed
147
  extends: .lets_encrypt_staging-common
148
  image: acme-dns-tiny:buster-slim
149
150
  after_script:
    - python3-coverage report
151
      --include=acme_dns_tiny.py,tools/acme_account_rollover.py,tools/acme_account_deactivate.py
152
    - python3-coverage html
153
154
155
  artifacts:
    paths:
     - htmlcov