.gitlab-ci.yml 2.68 KB
Newer Older
1
stages:
2
  - build
3
  - check
4
  - unit_test
5 6
  - lets_encrypt_staging

7 8
.build:
  stage: build
9
  image: docker:stable
10 11 12
  only:
    - merge_requests
    - master
13

14 15
.check:
  stage: check
16
  image: acme-dns-tiny:buster-slim
17 18 19 20
  only:
    - merge_requests
    - master

21 22
.unit_test:
  stage: unit_test
Adrien Dorsaz's avatar
Adrien Dorsaz committed
23 24 25
  script:
    - python3-coverage run --append --source ./ -m unittest -v
      tests.unit_test_acme_dns_tiny
26 27 28
  only:
    - merge_requests
    - master
29

30 31 32
.lets_encrypt_staging:
  stage: lets_encrypt_staging
  script:
33 34 35 36
    - 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
37 38 39 40
  only:
    - merge_requests
    - master

41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
jessie-slim:
  extends: .build
  script:
  - docker build -t "acme-dns-tiny:jessie-slim"
                 -f "docker/jessie/Dockerfile" .

stretch-slim:
  extends: .build
  script:
  - docker build -t "acme-dns-tiny:stretch-slim"
                 -f "docker/stretch/Dockerfile" .

buster-slim:
  extends: .build
  script:
  - docker build -t "acme-dns-tiny:buster-slim"
                 -f "docker/buster/Dockerfile" .

59 60 61 62 63 64 65 66
compile:
  extends: .check
  script:
    - python3 -m py_compile acme_dns_tiny.py tools/*.py tests/*.py

lint:
  extends: .check
  script:
67 68 69 70 71 72 73 74
    - 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
75

Adrien Dorsaz's avatar
Adrien Dorsaz committed
76 77 78
pep8:
  extends: .check
  script:
79 80
    - 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
81

82
jessie-ut:
83
  extends: .unit_test
84
  image: acme-dns-tiny:jessie-slim
85

86
stretch-ut:
87
  extends: .unit_test
88
  image: acme-dns-tiny:stretch-slim
89

90
buster-ut:
91
  extends: .unit_test
92
  image: acme-dns-tiny:buster-slim
93 94 95
  artifacts:
    paths:
      - .coverage
96

97
jessie-le-staging:
98
  extends: .lets_encrypt_staging
99
  image: acme-dns-tiny:jessie-slim
100

101
stretch-le-staging:
102
  extends: .lets_encrypt_staging
103
  image: acme-dns-tiny:stretch-slim
104

105
buster-le-staging:
106
  extends: .lets_encrypt_staging
107
  image: acme-dns-tiny:buster-slim
108 109
  after_script:
    - python3-coverage report
110
      --include=acme_dns_tiny.py,tools/acme_account_rollover.py,tools/acme_account_deactivate.py
111
    - python3-coverage html
112 113 114
  artifacts:
    paths:
     - htmlcov