ansible-collection-famedly-.../.gitlab-ci.yml
2022-08-10 18:34:26 +02:00

54 lines
1.2 KiB
YAML

include:
- project: 'famedly/company/devops/templates/ci-cd'
ref: 'ansible-v1'
file: '/ansible.yml'
stages:
- test
- build
- publish
# Debian Stable
sanity 3.9:
variables: { PYTHON_VERSION: "3.9", ANSIBLE_VERSION: "2.13.2" }
extends: .ansible-test-sanity
# Latest stable Python
sanity 3.10:
variables: { PYTHON_VERSION: "3.10", ANSIBLE_VERSION: "2.13.2" }
extends: .ansible-test-sanity
unit:
variables: { PYTHON_VERSION: "3.10" }
extends: .ansible-test-units
integration:
variables: { PYTHON_VERSION: "3.10" }
extends: .ansible-test-integration
black:
stage: test
image: registry.gitlab.com/pipeline-components/black:latest
script:
- black --check --verbose -- plugins
build:
image: docker.io/alpine
stage: build
before_script:
- apk add --no-cache ansible
script:
- ansible-galaxy collection build
artifacts:
paths:
- famedly-matrix-*.tar.gz
publish:
image: docker.io/alpine
stage: publish
before_script:
- apk add --no-cache ansible
script:
- ansible-galaxy collection publish ./famedly-matrix-*.tar.gz --api-key ${ANSIBLE_GALAXY_API_TOKEN}
rules:
- if: '$CI_COMMIT_TAG && $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/'