Commit d3f1a8de authored by Adrien Dorsaz's avatar Adrien Dorsaz

gitlab: build docker images to avoid to always apt-get dependencies

parent 58c069db
Pipeline #261 failed
/docker
/.gitlab-ci.yml
stages: stages:
- build
- check - check
- unit_test - unit_test
- lets_encrypt_staging - lets_encrypt_staging
.install_dependencies: &install_dependencies .build:
- apt-get update && apt-get install -y --no-install-recommends stage: build
python3-minimal python3-dnspython python3-requests image: docker.io/library/docker
only:
- merge_requests
- master
.check: .check:
stage: check stage: check
image: debian:buster-slim image: acme-dns-tiny:buster-slim
only: only:
- merge_requests - merge_requests
- master - master
.unit_test: .unit_test:
stage: unit_test stage: unit_test
before_script:
- *install_dependencies
- apt-get install -y --no-install-recommends python3-coverage
script:
- python3-coverage run --append --source ./ -m unittest -v
tests.unit_test_acme_dns_tiny
artifacts: artifacts:
paths: paths:
- .coverage - .coverage
only:
- merge_requests
- master
.lets_encrypt_staging: .lets_encrypt_staging:
stage: lets_encrypt_staging stage: lets_encrypt_staging
before_script:
- *install_dependencies
- apt-get install -y --no-install-recommends python3-coverage
script: script:
- python3-coverage run --append --source ./ -m unittest -v - python3-coverage run --append --source ./ -m unittest -v
tests.staging_test_acme_dns_tiny tests.staging_test_acme_dns_tiny
...@@ -43,50 +41,64 @@ stages: ...@@ -43,50 +41,64 @@ stages:
- merge_requests - merge_requests
- master - master
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" .
compile: compile:
extends: .check extends: .check
before_script:
- apt-get update && apt-get install -y --no-install-recommends
python3-minimal
script: script:
- python3 -m py_compile acme_dns_tiny.py tools/*.py tests/*.py - python3 -m py_compile acme_dns_tiny.py tools/*.py tests/*.py
lint: lint:
extends: .check extends: .check
before_script:
- *install_dependencies
- apt-get install -y --no-install-recommends pylint3
script: script:
- pylint3 acme_dns_tiny.py - pylint3 acme_dns_tiny.py
- pylint3 tools/acme_account_deactivate.py - pylint3 tools/acme_account_deactivate.py
- pylint3 tools/acme_account_rollover.py - pylint3 tools/acme_account_rollover.py
- pylint3 tests/config_factory.py - pylint3 tests/config_factory.py
- pylint3 tests/test_acme_dns_tiny.py - pylint3 tests/staging_test_acme_dns_tiny.py
- pylint3 tests/test_acme_account_deactivate.py - pylint3 tests/unit_test_acme_dns_tiny.py
- pylint3 tests/staging_test_acme_account_deactivate.py
- pylint3 tests/staging_test_acme_account_rollover.py
jessie_unit_tests: jessie-ut:
extends: .unit_test extends: .unit_test
image: debian:jessie-slim image: acme-dns-tiny:jessie-slim
stretch_unit_tests: stretch-ut:
extends: .unit_test extends: .unit_test
image: debian:stretch-slim image: acme-dns-tiny:stretch-slim
buster_unit_tests: buster-ut:
extends: .unit_test extends: .unit_test
image: debian:buster-slim image: acme-dns-tiny:buster-slim
jessie: jessie-le-staging:
extends: .lets_encrypt_staging extends: .lets_encrypt_staging
image: debian:jessie-slim image: acme-dns-tiny:jessie-slim
stretch: stretch-le-staging:
extends: .lets_encrypt_staging extends: .lets_encrypt_staging
image: debian:stretch-slim image: acme-dns-tiny:stretch-slim
buster: buster-le-staging:
extends: .lets_encrypt_staging extends: .lets_encrypt_staging
image: debian:buster-slim image: acme-dns-tiny:buster-slim
after_script: after_script:
- python3-coverage report - python3-coverage report
--include=acme_dns_tiny.py --include=acme_dns_tiny.py
......
FROM debian:buster-slim
WORKDIR acme_dns_tiny
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
python3-minimal python3-dnspython python3-requests \
python3-coverage python3-lint \
&& apt-get clean
COPY . .
FROM debian:jessie-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
python3-minimal python3-dnspython python3-requests \
python3-coverage \
&& apt-get clean
FROM debian:jessie-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
python3-minimal python3-dnspython python3-requests \
python3-coverage \
&& apt-get clean
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment