From 1fa8125a51c019822e6977e6d93e405093334b2e Mon Sep 17 00:00:00 2001 From: David Murphy Date: Mon, 11 Nov 2024 13:49:28 -0700 Subject: [PATCH] Playing with conditionals --- .github/workflows/test-linux.yml | 15 +++++++++++---- bootstrap-salt.sh | 19 ++++++++++++++++--- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index a77a1ca..e6a5be5 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -45,17 +45,24 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Python Dependencies + - name: Install Python Dependencies with pip breakage + if: ${{ ( inputs.distro-slug = "debian-11" ) || ( inputs.distro-slug = "debian-12" ) || ( inputs.distro-slug = "debian-13" ) || ( inputs.distro-slug = "ubuntu-2404" ) }} run: | echo "DGM pip test for distro-slug ${{ inputs.distro-slug }}" - if [[ "${{ inputs.distro-slug }}" == "debian-11" || "${{ inputs.distro-slug }}" == "debian-12" || "${{ inputs.distro-slug }}" == "debian-13" || "${{ inputs.distro-slug }}" == "ubuntu-2404" ]]; then - echo "DGM doing break-system-packages for distro-slug ${{ inputs.distro-slug }}" - python3 -m pip install --break-system-packages -r tests/requirements.txt + echo "DGM doing break-system-packages for distro-slug ${{ inputs.distro-slug }}" + python3 -m pip install --break-system-packages -r tests/requirements.txt else echo "DGM plain pip for distro-slug ${{ inputs.distro-slug }}" python3 -m pip install -r tests/requirements.txt fi + - name: Install Python Dependencies without pip breakage + if: ${{ ( inputs.distro-slug != "debian-11" ) && ( inputs.distro-slug != "debian-12" ) && ( inputs.distro-slug != "debian-13" ) && ( inputs.distro-slug != "ubuntu-2404" ) }} + run: | + echo "DGM pip test for distro-slug ${{ inputs.distro-slug }}" + echo "DGM plain pip for distro-slug ${{ inputs.distro-slug }}" + python3 -m pip install -r tests/requirements.txt + - name: Bootstrap Salt run: | echo "matrix instance ,${{ matrix.instance }}," diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 6b81597..9028f7b 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -26,7 +26,7 @@ #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2024.11.07" +__ScriptVersion="2024.11.11" __ScriptName="bootstrap-salt.sh" __ScriptFullName="$0" @@ -221,6 +221,10 @@ __check_config_dir() { # DESCRIPTION: Checks the placed after the install arguments #---------------------------------------------------------------------------------------------------------------------- __check_unparsed_options() { + # DGM debug + set -v + set -x + shellopts="$1" # grep alternative for SunOS if [ -f /usr/xpg4/bin/grep ]; then @@ -619,13 +623,22 @@ if [ "$#" -gt 0 ];then fi # Check installation type -if [ "$(echo "$ITYPE" | grep -E '(stable|testing|git|onedir|onedir_rc)')" = "" ]; then +if [ "$(echo "$ITYPE" | grep -E '(latest|default|stable|testing|git|onedir|onedir_rc)')" = "" ]; then echoerror "Installation type \"$ITYPE\" is not known..." exit 1 fi +## DGM added this to CI/CD easier, needs removal once get compund conditionals resolved in GitHub Actions +if [ "$ITYPE" = "latest" ] || [ "$ITYPE" = "default" ]; then + STABLE_REV="latest" + ONEDIR_REV="latest" + _ONEDIR_REV="latest" + ITYPE="onedir" + shift + echodebug "using ITYPE onedir for input 'latest' or 'default', cmd args left ,$#," + # If doing a git install, check what branch/tag/sha will be checked out -if [ "$ITYPE" = "git" ]; then +elif [ "$ITYPE" = "git" ]; then if [ "$#" -eq 0 ];then GIT_REV="master" else