From 52653f2843c470bbb6a2424aeb06eb16c43ed698 Mon Sep 17 00:00:00 2001 From: Andrew <84722778+andrew-jameson@users.noreply.github.com> Date: Thu, 5 Dec 2024 10:57:41 -0500 Subject: [PATCH] Hotfix/cf check (#3340) * Standardizing on use of cf-check on older workflow * Standardizing use of cf-check on older workflows * terraform executor edge-case * Testing pipeline with non-develop branch * included this branch for deployment workflows * exclude duplicate deploy-dev workflow * more exclusions for hotfix branch * apk doesn't have install, use add * certifying whole pipeline runs for this branch * Removing branch-specific carve-outs in pipeline --------- Co-authored-by: jtimpe <111305129+jtimpe@users.noreply.github.com> --- .circleci/deployment/commands.yml | 1 + scripts/cf-check.sh | 6 +++--- scripts/sudo-check.sh | 10 ++++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.circleci/deployment/commands.yml b/.circleci/deployment/commands.yml index 180d0847e..992f6440d 100644 --- a/.circleci/deployment/commands.yml +++ b/.circleci/deployment/commands.yml @@ -226,6 +226,7 @@ default: CF_APP steps: - checkout + - sudo-check - cf-check - login-cloud-dot-gov: cf-password: <> diff --git a/scripts/cf-check.sh b/scripts/cf-check.sh index cc0eddd27..684e38492 100755 --- a/scripts/cf-check.sh +++ b/scripts/cf-check.sh @@ -4,9 +4,10 @@ if command -v cf /dev/null 2>&1; then echo The command cf is available else if [[ -f /bin/terraform ]]; then - echo "This is our Terraform executor" + echo "This is our Terraform executor, Alpine Linux v3.13" apk update - apk install curl jq + apk add curl jq + else apt-get update apt-get install curl wget gnupg2 apt-transport-https jq @@ -18,5 +19,4 @@ else tar xzf $NEXUS_ARCHIVE mv ./cf7 /usr/local/bin/cf cf --version - fi diff --git a/scripts/sudo-check.sh b/scripts/sudo-check.sh index 5438bcef9..a604430b7 100755 --- a/scripts/sudo-check.sh +++ b/scripts/sudo-check.sh @@ -4,6 +4,12 @@ if command -v sudo /dev/null 2>&1; then echo The command sudo is available else echo The command sudo is not available installing... - apt-get update && apt-get install -y sudo - ls -al /bin/sh && sudo rm /bin/sh && sudo ln -s /bin/bash /bin/sh && ls -al /bin/sh + if [ -f /bin/terraform ]; then + echo "This is our Terraform executor, Alpine Linux v3.13" + apk update + apk add sudo + else + apt-get update && apt-get install -y sudo + ls -al /bin/sh && sudo rm /bin/sh && sudo ln -s /bin/bash /bin/sh && ls -al /bin/sh + fi fi \ No newline at end of file