---
stages:
- test
- publish
.use-python:
image: python:3.7.6-slim-buster
.docker-build-setup:
image: docker:19.03.8
services:
- docker:19.03.8-dind
.install-make: &install-make
- apk add --no-cache make
test:dockerfile-lint:
image: hadolint/hadolint:v1.17.5-alpine
script:
- hadolint ./Dockerfile
only:
refs:
- merge_requests
changes:
- Dockerfile
except:
- master
test:docker-image-build:
extends: .docker-build-setup
- *install-make
- make image
stage: test
test:custom-modules:
extends: .use-python
before_script:
- apt-get update && apt-get install make
- pip install ansible==2.9.6
- make test_modules_unit
- library/*
publish:docker-image:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
after_script:
- docker logout ${CI_REGISTRY}
- make publish
- /^v[0-9]+(.[0-9]+){2}$/
variables:
IMAGE_NAME: ${CI_REGISTRY}/${CI_PROJECT_PATH}
IMAGE_TAG: ${CI_COMMIT_REF_NAME}