From 5775d04d850ba6ef78f63afa8f676aae332d22ad Mon Sep 17 00:00:00 2001 From: alexanderbazhenoff Date: Sat, 6 Apr 2024 23:11:26 +0300 Subject: [PATCH] fixes debug v2 --- .../workflows/ansible_molecule_teststing.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ansible_molecule_teststing.yml b/.github/workflows/ansible_molecule_teststing.yml index 40247fe..b481004 100644 --- a/.github/workflows/ansible_molecule_teststing.yml +++ b/.github/workflows/ansible_molecule_teststing.yml @@ -13,6 +13,9 @@ concurrency: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: true +env: + PREINSTALL_MOLECULE_REQUIREMENTS: 'true' + jobs: test_bareos: runs-on: ubuntu-latest @@ -56,26 +59,21 @@ jobs: poetry --version || true ESC="$(printf "\033")" printf "Packages:\n%s\n \n" "$(poetry --ansi run pip list | sed -e "s/ /${ESC}[1;35m /g; s/$/${ESC}[0m/g")" - sudo --version || true - poetry --ansi run ansible --version - poetry --ansi run ansible-galaxy --version - ls -lha /tmp || true - ls -lh / | grep tmp || true - name: Molecule test shell: bash run: | printf "[defaults]\nremote_tmp = /tmp/.ansible-\${USER}/tmp" > $HOME/.ansible.cfg cd roles/bareos DEBUG_OPT=$([[ "$COMMIT_MSG" =~ .(debug) ]] && echo "--debug") - VERBOSE_OPT=$([[ "$COMMIT_MSG" =~ .(debug).v([1-3]) ]] && echo "-v ${COMMIT_MSG/*debug v/}") + VERB_OPT=$([[ "$COMMIT_MSG" =~ .(debug).v([1-6]) ]] && printf '-%*s' "${COMMIT_MSG/*debug v/}" | tr ' ' 'v') echo "DEBUG_OPT: $DEBUG_OPT" - echo "VERBOSE_OPT: $VERBOSE_OPT" + echo "VERB_OPT: $VERB_OPT" set -x - if [[ -f "molecule/default/requirements.yml" ]]; then + if $PREINSTALL_MOLECULE_REQUIREMENTS && [[ -f "molecule/default/requirements.yml" ]]; then poetry --ansi run ansible-galaxy install -r molecule/default/requirements.yml \ - --server https://old-galaxy.ansible.com --timeout 300 $VERBOSE_OPT + --server https://old-galaxy.ansible.com --timeout 300 $VERB_OPT fi - poetry --ansi run molecule $DEBUG_OPT $VERBOSE_OPT test + poetry --ansi run molecule $DEBUG_OPT $VERB_OPT test env: PY_COLORS: '1' ANSIBLE_FORCE_COLOR: '1'