From 94c150b2e7411317c26455e3384d3ef81a1ff388 Mon Sep 17 00:00:00 2001 From: Jakob Meng Date: Fri, 9 Dec 2022 13:23:35 +0100 Subject: [PATCH] Allow all external commands in tox Change-Id: I76e0fc0e574d791e8f4d83ccc22289fa06360709 --- ci/run-ansible-tests-collection.sh | 0 tools/run-ansible-sanity.sh | 0 tox.ini | 18 ++++++++++-------- 3 files changed, 10 insertions(+), 8 deletions(-) mode change 100644 => 100755 ci/run-ansible-tests-collection.sh mode change 100644 => 100755 tools/run-ansible-sanity.sh diff --git a/ci/run-ansible-tests-collection.sh b/ci/run-ansible-tests-collection.sh old mode 100644 new mode 100755 diff --git a/tools/run-ansible-sanity.sh b/tools/run-ansible-sanity.sh old mode 100644 new mode 100755 diff --git a/tox.ini b/tox.ini index 371aed54..b658fe86 100644 --- a/tox.ini +++ b/tox.ini @@ -24,7 +24,6 @@ deps = -c{env:TOX_CONSTRAINTS_FILE:{toxinidir}/tests/constraints-none.txt} -r{toxinidir}/tests/requirements.txt pip: {toxinidir} - commands = stestr run {posargs} stestr slowest @@ -33,19 +32,20 @@ commands = flake8 [testenv:build] +allowlist_externals = bash deps = ansible-core galaxy-importer pbr ruamel.yaml - commands = python {toxinidir}/tools/build.py ansible --version ansible-galaxy collection build --force {toxinidir} --output-path {toxinidir}/build_artifact - /bin/bash {toxinidir}/tools/check-import.sh {toxinidir} + bash {toxinidir}/tools/check-import.sh {toxinidir} [testenv:linters] +allowlist_externals = bash passenv = * deps = {[testenv]deps} @@ -53,7 +53,7 @@ commands = {[testenv:build]commands} {[testenv:pep8]commands} ansible --version - /bin/bash {toxinidir}/tools/run-ansible-sanity.sh {toxinidir} + bash {toxinidir}/tools/run-ansible-sanity.sh {toxinidir} [testenv:linters-2.9] passenv = {[testenv:linters]passenv} @@ -88,6 +88,7 @@ show-source = True exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,ansible_collections [testenv:ansible] +allowlist_externals = bash # Need to pass some env vars for the Ansible playbooks passenv = HOME @@ -96,7 +97,7 @@ passenv = deps = {[testenv]deps} commands = - /bin/bash {toxinidir}/ci/run-ansible-tests-collection.sh -e {envdir} {posargs} + bash {toxinidir}/ci/run-ansible-tests-collection.sh -e {envdir} {posargs} [testenv:ansible-2.9] deps = @@ -120,11 +121,12 @@ passenv = {[testenv:ansible]passenv} commands = {[testenv:ansible]commands} [testenv:galaxy-release] +allowlist_externals = mkdir rm sed 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 + rm -rf /tmp/collection_built/ + mkdir -p /tmp/collection_built/ + 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}