Add automatic release job triggered by tag

Currently put it in pre-release pipeline to test that it's ok.

Change-Id: I791478464ed59933273bb0e5f88f3636074c6729
This commit is contained in:
Sagi Shnaidman
2021-07-26 21:11:26 +03:00
parent 938b90ea19
commit 5ef192f1f2
3 changed files with 112 additions and 0 deletions

10
tox.ini
View File

@@ -111,3 +111,13 @@ deps =
-r{toxinidir}/test-requirements-2.11.txt
passenv = {[testenv:ansible]passenv}
commands = {[testenv:ansible]commands}
[testenv:galaxy-release]
deps =
ansible-core
commands =
/usr/bin/mkdir -p /tmp/collection_built
/usr/bin/bash -ec 'rm -rf /tmp/collection_built/*'
/usr/bin/sed -i "s/version:.*/version: {env:VERSION_TAG}/" {toxinidir}/galaxy.yml
ansible-galaxy collection build {toxinidir} --output-path /tmp/collection_built/ --force
ansible-galaxy collection publish /tmp/collection_built/openstack-cloud-{env:VERSION_TAG}.tar.gz --token {env:API_GALAXY_TOKEN}