diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ac59ffdd9e589a821987c9bc844aa37fd2338b8c..8098217720d89ff5219ed768093f461f67a49024 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,25 @@ --- stages: + - build - lint + - publish + +build: + stage: build + needs: [] + image: alpine:latest + only: + - tags + script: + - cd .. + - tar czvf ansible-galaxy.tar.gz --exclude=.git "${CI_PROJECT_NAME}/" + - cd "${CI_PROJECT_NAME}" + - mv ../ansible-galaxy.tar.gz . + artifacts: + when: on_success + paths: + - ansible-galaxy.tar.gz ansible: stage: lint @@ -16,3 +34,15 @@ yaml: image: registry.cri.epita.fr/cri/docker/ansible/master script: - yamllint -f colored . + +publish: + stage: publish + image: curlimages/curl:latest + only: + - tags + script: + - | + curl \ + --header "JOB-TOKEN: $CI_JOB_TOKEN" \ + --upload-file ansible-galaxy.tar.gz \ + "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/acme/${CI_COMMIT_TAG}/ansible-galaxy.tar.gz"