mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-05-08 14:23:03 +00:00
Merge "Remove old artifacts when building new ones"
This commit is contained in:
@@ -22,6 +22,8 @@ import pbr.version
|
|||||||
|
|
||||||
from ruamel.yaml import YAML
|
from ruamel.yaml import YAML
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
def generate_version_info():
|
def generate_version_info():
|
||||||
version_info = pbr.version.VersionInfo('openstack-cloud')
|
version_info = pbr.version.VersionInfo('openstack-cloud')
|
||||||
@@ -39,8 +41,16 @@ def generate_version_info():
|
|||||||
yaml.dump(config, fp)
|
yaml.dump(config, fp)
|
||||||
|
|
||||||
|
|
||||||
|
def clean_build():
|
||||||
|
if not os.path.exists('build_artifact'):
|
||||||
|
return
|
||||||
|
for tarball in os.listdir('build_artifact'):
|
||||||
|
os.unlink('build_artifact/{tarball}'.format(tarball=tarball))
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
generate_version_info()
|
generate_version_info()
|
||||||
|
clean_build()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
3
tox.ini
3
tox.ini
@@ -34,8 +34,7 @@ commands =
|
|||||||
[testenv:linters]
|
[testenv:linters]
|
||||||
passenv = *
|
passenv = *
|
||||||
commands =
|
commands =
|
||||||
{toxinidir}/tools/build.py
|
{[testenv:build]commands}
|
||||||
ansible-galaxy collection build --force {toxinidir} --output-path {toxinidir}/build_artifact
|
|
||||||
/bin/bash -c "ansible-galaxy collection install $(ls {toxinidir}/build_artifact/openstack-cloud-*) --force -p {toxinidir}"
|
/bin/bash -c "ansible-galaxy collection install $(ls {toxinidir}/build_artifact/openstack-cloud-*) --force -p {toxinidir}"
|
||||||
/bin/bash -c "cd ansible_collections/openstack/cloud && ansible-test sanity"
|
/bin/bash -c "cd ansible_collections/openstack/cloud && ansible-test sanity"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user