From 8f6b3f2a2b48fabb11e58cd11c720f390906dd90 Mon Sep 17 00:00:00 2001 From: Brian Vu Date: Wed, 29 Nov 2023 20:31:52 -0800 Subject: [PATCH 1/5] ci: add test to bypass installation if version matches --- .circleci/test-deploy.yml | 287 ++++++++++++++++++++------------------ 1 file changed, 154 insertions(+), 133 deletions(-) diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index 3639b3c..1cd218a 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -114,152 +114,173 @@ jobs: workflows: test-deploy: jobs: - # Testing region configuration + # # Testing region configuration + # - integration-test-install: + # name: integration-test-configure-profile-region + # role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST + # profile_name: "OIDC-User" + # context: [CPE-OIDC] + # configure_default_region: false + # region: us-west-2 + # executor: docker-base + # post-steps: + # - run: + # name: Checking ~/.aws/config for profile region + # command: | + # if grep "\[profile OIDC-User\]" ~/.aws/config && grep "us-west-2" ~/.aws/config;then + # echo "Profile region properly configured" + # exit 0 + # else + # echo "Profile region not properly configured" + # exit 1 + # fi + # - integration-test-install: + # name: integration-test-configure-default-region + # role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST + # profile_name: "OIDC-User" + # context: [CPE-OIDC] + # configure_profile_region: false + # region: us-west-1 + # executor: docker-base + # post-steps: + # - run: + # name: Checking ~/.aws/config for default region + # command: | + # if grep "\[default\]" ~/.aws/config && grep "us-west-1" ~/.aws/config;then + # echo "Default region properly configured" + # exit 0 + # else + # echo "Default region not properly configured" + # exit 1 + # fi + # # Testing OIDC + # - integration-test-install: + # name: integration test web identity command with white spaces + # role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST + # context: [CPE-OIDC] + # executor: docker-base + # post-steps: + # - run: + # name: Web Identity Test - Logging into ECR + # command: aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 122211685980.dkr.ecr.us-west-2.amazonaws.com + # - integration-test-install: + # name: integration-test-web-identity-parameters + # role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST + # session_duration: "${TEST_SESSION_DURATION}" + # context: [CPE-OIDC] + # executor: docker-base + # role_session_name: "test-Sess!on Wi7h inv^l!d-characters that's longer than 64 chars" + # post-steps: + # - run: + # name: Check Values of Expanded Variables + # command: | + # if [ "${TEST_SESSION_DURATION}" -eq "900" ]; then + # exit 0 + # else + # exit 1 + # fi + # - integration-test-install: + # name: integration-test-web-identity-with-profile + # role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST + # profile_name: "OIDC-Tester" + # context: [CPE-OIDC] + # executor: docker-base + # post-steps: + # - run: + # name: Web Identity Test - Logging into ECR + # command: aws ecr get-login-password --region us-west-2 --profile "OIDC-Tester" | docker login --username AWS --password-stdin 122211685980.dkr.ecr.us-west-2.amazonaws.com + # # Testing executors that do not AWS CLI pre-installed + # - integration-test-install: + # name: integration-test-install-<> + # context: [CPE_ORBS_AWS] + # matrix: + # alias: test-install + # parameters: + # executor: ["docker-base", "macos", "alpine", "docker-nounset-shell", terraform ] + # filters: *filters + # post-steps: + # - check_aws_version + # # Test installing specific versions on executors without AWS pre-installed + # - integration-test-install: + # name: integration-test-install-version-<> + # context: [CPE_ORBS_AWS] + # matrix: + # alias: test-install-version + # parameters: + # executor: ["docker-base", "macos", "alpine", "docker-nounset-shell" ] + # version: "2.1.10" + # filters: *filters + # post-steps: + # - check_aws_version: + # version: "2.1.10" + # # Test overriding existing version of AWS pre-installed + # - integration-test-install: + # name: integration-test-install-override-version-<> + # context: [CPE_ORBS_AWS] + # matrix: + # alias: test-install-override-version + # parameters: + # executor: ["linuxvm", "windows", "arm"] + # version: "2.1.10" + # install_dir: "/usr/local/aws-cli" + # binary_dir: "" + # override_installed: false + # filters: *filters + # post-steps: + # - check_aws_version: + # version: "2.1.10" - integration-test-install: - name: integration-test-configure-profile-region - role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST - profile_name: "OIDC-User" - context: [CPE-OIDC] - configure_default_region: false - region: us-west-2 - executor: docker-base - post-steps: - - run: - name: Checking ~/.aws/config for profile region - command: | - if grep "\[profile OIDC-User\]" ~/.aws/config && grep "us-west-2" ~/.aws/config;then - echo "Profile region properly configured" - exit 0 - else - echo "Profile region not properly configured" - exit 1 - fi - - integration-test-install: - name: integration-test-configure-default-region - role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST - profile_name: "OIDC-User" - context: [CPE-OIDC] - configure_profile_region: false - region: us-west-1 - executor: docker-base - post-steps: - - run: - name: Checking ~/.aws/config for default region - command: | - if grep "\[default\]" ~/.aws/config && grep "us-west-1" ~/.aws/config;then - echo "Default region properly configured" - exit 0 - else - echo "Default region not properly configured" - exit 1 - fi - # Testing OIDC - - integration-test-install: - name: integration test web identity command with white spaces - role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST - context: [CPE-OIDC] - executor: docker-base - post-steps: - - run: - name: Web Identity Test - Logging into ECR - command: aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 122211685980.dkr.ecr.us-west-2.amazonaws.com - - integration-test-install: - name: integration-test-web-identity-parameters - role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST - session_duration: "${TEST_SESSION_DURATION}" - context: [CPE-OIDC] - executor: docker-base - role_session_name: "test-Sess!on Wi7h inv^l!d-characters that's longer than 64 chars" - post-steps: - - run: - name: Check Values of Expanded Variables - command: | - if [ "${TEST_SESSION_DURATION}" -eq "900" ]; then - exit 0 - else - exit 1 - fi - - integration-test-install: - name: integration-test-web-identity-with-profile - role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST - profile_name: "OIDC-Tester" - context: [CPE-OIDC] - executor: docker-base - post-steps: - - run: - name: Web Identity Test - Logging into ECR - command: aws ecr get-login-password --region us-west-2 --profile "OIDC-Tester" | docker login --username AWS --password-stdin 122211685980.dkr.ecr.us-west-2.amazonaws.com - # Testing executors that do not AWS CLI pre-installed - - integration-test-install: - name: integration-test-install-<> - context: [CPE_ORBS_AWS] - matrix: - alias: test-install - parameters: - executor: ["docker-base", "macos", "alpine", "docker-nounset-shell", terraform ] - filters: *filters - post-steps: - - check_aws_version - # Test installing specific versions on executors without AWS pre-installed - - integration-test-install: - name: integration-test-install-version-<> - context: [CPE_ORBS_AWS] - matrix: - alias: test-install-version - parameters: - executor: ["docker-base", "macos", "alpine", "docker-nounset-shell" ] - version: "2.1.10" - filters: *filters - post-steps: - - check_aws_version: - version: "2.1.10" - # Test overriding existing version of AWS pre-installed - - integration-test-install: - name: integration-test-install-override-version-<> + name: integration-test-skip-install-matched-version context: [CPE_ORBS_AWS] matrix: alias: test-install-override-version parameters: - executor: ["linuxvm", "windows", "arm"] + executor: [ "arm" ] version: "2.1.10" install_dir: "/usr/local/aws-cli" binary_dir: "" override_installed: false filters: *filters + pre-steps: + - run: + command: | + set -x + aws --version + set +x post-steps: - check_aws_version: version: "2.1.10" - - integration-test-install: - name: integration-test-install-override-version-with-latest-<> - context: [CPE_ORBS_AWS] - matrix: - alias: test-install-override-version-with-latest - parameters: - executor: ["linuxvm", "windows", "arm"] - install_dir: "/usr/local/aws-cli" - binary_dir: "" - override_installed: true - filters: *filters - - integration-test-role-arn-setup: - name: integration-test-role-arn-config - source_profile: default - profile_name: CircleCI-Tester - role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST - context: [CPE_ORBS_AWS] - post-steps: - - run: - name: Logging into ECR with new profile - command: aws ecr get-login-password --region us-west-2 --profile "CircleCI-Tester" | docker login --username AWS --password-stdin 122211685980.dkr.ecr.us-west-2.amazonaws.com - - orb-tools/pack: - filters: *release-filters - - orb-tools/publish: - orb_name: circleci/aws-cli - vcs_type: << pipeline.project.type >> - pub_type: production - enable_pr_comment: true - context: orb-publisher - requires: [orb-tools/pack, test-install, test-install-version, test-install-override-version, integration-test-web-identity-with-profile, integration test web identity command with white spaces,integration-test-role-arn-config, test-install-override-version-with-latest] - filters: *release-filters + # - integration-test-install: + # name: integration-test-install-override-version-with-latest-<> + # context: [CPE_ORBS_AWS] + # matrix: + # alias: test-install-override-version-with-latest + # parameters: + # executor: ["linuxvm", "windows", "arm"] + # install_dir: "/usr/local/aws-cli" + # binary_dir: "" + # override_installed: true + # filters: *filters + # - integration-test-role-arn-setup: + # name: integration-test-role-arn-config + # source_profile: default + # profile_name: CircleCI-Tester + # role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST + # context: [CPE_ORBS_AWS] + # post-steps: + # - run: + # name: Logging into ECR with new profile + # command: aws ecr get-login-password --region us-west-2 --profile "CircleCI-Tester" | docker login --username AWS --password-stdin 122211685980.dkr.ecr.us-west-2.amazonaws.com + # - orb-tools/pack: + # filters: *release-filters + # - orb-tools/publish: + # orb_name: circleci/aws-cli + # vcs_type: << pipeline.project.type >> + # pub_type: production + # enable_pr_comment: true + # context: orb-publisher + # requires: [orb-tools/pack, test-install, test-install-version, test-install-override-version, integration-test-web-identity-with-profile, integration test web identity command with white spaces,integration-test-role-arn-config, test-install-override-version-with-latest] + # filters: *release-filters executors: terraform: docker: From 05ae7a99b2f7148790fd7d8da011f9e3b3d76e4e Mon Sep 17 00:00:00 2001 From: Brian Vu Date: Wed, 29 Nov 2023 20:43:19 -0800 Subject: [PATCH 2/5] fix: add validation to check for specified version --- .circleci/test-deploy.yml | 301 +++++++++++++++++++------------------- src/scripts/install.sh | 3 + 2 files changed, 150 insertions(+), 154 deletions(-) diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index 1cd218a..9ce701b 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -114,173 +114,166 @@ jobs: workflows: test-deploy: jobs: - # # Testing region configuration - # - integration-test-install: - # name: integration-test-configure-profile-region - # role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST - # profile_name: "OIDC-User" - # context: [CPE-OIDC] - # configure_default_region: false - # region: us-west-2 - # executor: docker-base - # post-steps: - # - run: - # name: Checking ~/.aws/config for profile region - # command: | - # if grep "\[profile OIDC-User\]" ~/.aws/config && grep "us-west-2" ~/.aws/config;then - # echo "Profile region properly configured" - # exit 0 - # else - # echo "Profile region not properly configured" - # exit 1 - # fi - # - integration-test-install: - # name: integration-test-configure-default-region - # role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST - # profile_name: "OIDC-User" - # context: [CPE-OIDC] - # configure_profile_region: false - # region: us-west-1 - # executor: docker-base - # post-steps: - # - run: - # name: Checking ~/.aws/config for default region - # command: | - # if grep "\[default\]" ~/.aws/config && grep "us-west-1" ~/.aws/config;then - # echo "Default region properly configured" - # exit 0 - # else - # echo "Default region not properly configured" - # exit 1 - # fi - # # Testing OIDC - # - integration-test-install: - # name: integration test web identity command with white spaces - # role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST - # context: [CPE-OIDC] - # executor: docker-base - # post-steps: - # - run: - # name: Web Identity Test - Logging into ECR - # command: aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 122211685980.dkr.ecr.us-west-2.amazonaws.com - # - integration-test-install: - # name: integration-test-web-identity-parameters - # role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST - # session_duration: "${TEST_SESSION_DURATION}" - # context: [CPE-OIDC] - # executor: docker-base - # role_session_name: "test-Sess!on Wi7h inv^l!d-characters that's longer than 64 chars" - # post-steps: - # - run: - # name: Check Values of Expanded Variables - # command: | - # if [ "${TEST_SESSION_DURATION}" -eq "900" ]; then - # exit 0 - # else - # exit 1 - # fi - # - integration-test-install: - # name: integration-test-web-identity-with-profile - # role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST - # profile_name: "OIDC-Tester" - # context: [CPE-OIDC] - # executor: docker-base - # post-steps: - # - run: - # name: Web Identity Test - Logging into ECR - # command: aws ecr get-login-password --region us-west-2 --profile "OIDC-Tester" | docker login --username AWS --password-stdin 122211685980.dkr.ecr.us-west-2.amazonaws.com - # # Testing executors that do not AWS CLI pre-installed - # - integration-test-install: - # name: integration-test-install-<> - # context: [CPE_ORBS_AWS] - # matrix: - # alias: test-install - # parameters: - # executor: ["docker-base", "macos", "alpine", "docker-nounset-shell", terraform ] - # filters: *filters - # post-steps: - # - check_aws_version - # # Test installing specific versions on executors without AWS pre-installed - # - integration-test-install: - # name: integration-test-install-version-<> - # context: [CPE_ORBS_AWS] - # matrix: - # alias: test-install-version - # parameters: - # executor: ["docker-base", "macos", "alpine", "docker-nounset-shell" ] - # version: "2.1.10" - # filters: *filters - # post-steps: - # - check_aws_version: - # version: "2.1.10" - # # Test overriding existing version of AWS pre-installed - # - integration-test-install: - # name: integration-test-install-override-version-<> - # context: [CPE_ORBS_AWS] - # matrix: - # alias: test-install-override-version - # parameters: - # executor: ["linuxvm", "windows", "arm"] - # version: "2.1.10" - # install_dir: "/usr/local/aws-cli" - # binary_dir: "" - # override_installed: false - # filters: *filters - # post-steps: - # - check_aws_version: - # version: "2.1.10" + # Testing region configuration - integration-test-install: - name: integration-test-skip-install-matched-version + name: integration-test-configure-profile-region + role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST + profile_name: "OIDC-User" + context: [CPE-OIDC] + configure_default_region: false + region: us-west-2 + executor: docker-base + post-steps: + - run: + name: Checking ~/.aws/config for profile region + command: | + if grep "\[profile OIDC-User\]" ~/.aws/config && grep "us-west-2" ~/.aws/config;then + echo "Profile region properly configured" + exit 0 + else + echo "Profile region not properly configured" + exit 1 + fi + - integration-test-install: + name: integration-test-configure-default-region + role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST + profile_name: "OIDC-User" + context: [CPE-OIDC] + configure_profile_region: false + region: us-west-1 + executor: docker-base + post-steps: + - run: + name: Checking ~/.aws/config for default region + command: | + if grep "\[default\]" ~/.aws/config && grep "us-west-1" ~/.aws/config;then + echo "Default region properly configured" + exit 0 + else + echo "Default region not properly configured" + exit 1 + fi + # Testing OIDC + - integration-test-install: + name: integration test web identity command with white spaces + role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST + context: [CPE-OIDC] + executor: docker-base + post-steps: + - run: + name: Web Identity Test - Logging into ECR + command: aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 122211685980.dkr.ecr.us-west-2.amazonaws.com + - integration-test-install: + name: integration-test-web-identity-parameters + role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST + session_duration: "${TEST_SESSION_DURATION}" + context: [CPE-OIDC] + executor: docker-base + role_session_name: "test-Sess!on Wi7h inv^l!d-characters that's longer than 64 chars" + post-steps: + - run: + name: Check Values of Expanded Variables + command: | + if [ "${TEST_SESSION_DURATION}" -eq "900" ]; then + exit 0 + else + exit 1 + fi + - integration-test-install: + name: integration-test-web-identity-with-profile + role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST + profile_name: "OIDC-Tester" + context: [CPE-OIDC] + executor: docker-base + post-steps: + - run: + name: Web Identity Test - Logging into ECR + command: aws ecr get-login-password --region us-west-2 --profile "OIDC-Tester" | docker login --username AWS --password-stdin 122211685980.dkr.ecr.us-west-2.amazonaws.com + # Testing executors that do not AWS CLI pre-installed + - integration-test-install: + name: integration-test-install-<> + context: [CPE_ORBS_AWS] + matrix: + alias: test-install + parameters: + executor: ["docker-base", "macos", "alpine", "docker-nounset-shell", terraform ] + filters: *filters + post-steps: + - check_aws_version + # Test installing specific versions on executors without AWS pre-installed + - integration-test-install: + name: integration-test-install-version-<> + context: [CPE_ORBS_AWS] + matrix: + alias: test-install-version + parameters: + executor: ["docker-base", "macos", "alpine", "docker-nounset-shell" ] + version: "2.1.10" + filters: *filters + post-steps: + - check_aws_version: + version: "2.1.10" + # Test overriding existing version of AWS pre-installed + - integration-test-install: + name: integration-test-install-override-version-<> context: [CPE_ORBS_AWS] matrix: alias: test-install-override-version parameters: - executor: [ "arm" ] + executor: ["linuxvm", "windows", "arm"] version: "2.1.10" install_dir: "/usr/local/aws-cli" binary_dir: "" override_installed: false filters: *filters - pre-steps: - - run: - command: | - set -x - aws --version - set +x post-steps: - check_aws_version: version: "2.1.10" - # - integration-test-install: - # name: integration-test-install-override-version-with-latest-<> - # context: [CPE_ORBS_AWS] - # matrix: - # alias: test-install-override-version-with-latest - # parameters: - # executor: ["linuxvm", "windows", "arm"] - # install_dir: "/usr/local/aws-cli" - # binary_dir: "" - # override_installed: true - # filters: *filters - # - integration-test-role-arn-setup: - # name: integration-test-role-arn-config - # source_profile: default - # profile_name: CircleCI-Tester - # role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST - # context: [CPE_ORBS_AWS] - # post-steps: - # - run: - # name: Logging into ECR with new profile - # command: aws ecr get-login-password --region us-west-2 --profile "CircleCI-Tester" | docker login --username AWS --password-stdin 122211685980.dkr.ecr.us-west-2.amazonaws.com - # - orb-tools/pack: - # filters: *release-filters - # - orb-tools/publish: - # orb_name: circleci/aws-cli - # vcs_type: << pipeline.project.type >> - # pub_type: production - # enable_pr_comment: true - # context: orb-publisher - # requires: [orb-tools/pack, test-install, test-install-version, test-install-override-version, integration-test-web-identity-with-profile, integration test web identity command with white spaces,integration-test-role-arn-config, test-install-override-version-with-latest] - # filters: *release-filters + - integration-test-install: + name: integration-test-skip-install-matched-version + context: [CPE_ORBS_AWS] + matrix: + alias: test-install-override-version + parameters: + executor: [ "arm" ] + version: "2.1.21" + install_dir: "/usr/local/aws-cli" + binary_dir: "" + filters: *filters + post-steps: + - check_aws_version: + version: "2.1.21" + - integration-test-install: + name: integration-test-install-override-version-with-latest-<> + context: [CPE_ORBS_AWS] + matrix: + alias: test-install-override-version-with-latest + parameters: + executor: ["linuxvm", "windows", "arm"] + install_dir: "/usr/local/aws-cli" + binary_dir: "" + override_installed: true + filters: *filters + - integration-test-role-arn-setup: + name: integration-test-role-arn-config + source_profile: default + profile_name: CircleCI-Tester + role_arn: arn:aws:iam::122211685980:role/CPE_ECR_OIDC_TEST + context: [CPE_ORBS_AWS] + post-steps: + - run: + name: Logging into ECR with new profile + command: aws ecr get-login-password --region us-west-2 --profile "CircleCI-Tester" | docker login --username AWS --password-stdin 122211685980.dkr.ecr.us-west-2.amazonaws.com + - orb-tools/pack: + filters: *release-filters + - orb-tools/publish: + orb_name: circleci/aws-cli + vcs_type: << pipeline.project.type >> + pub_type: production + enable_pr_comment: true + context: orb-publisher + requires: [orb-tools/pack, test-install, test-install-version, test-install-override-version, integration-test-web-identity-with-profile, integration test web identity command with white spaces,integration-test-role-arn-config, test-install-override-version-with-latest, integration-test-skip-install-matched-version] + filters: *release-filters executors: terraform: docker: diff --git a/src/scripts/install.sh b/src/scripts/install.sh index e81207b..d13b733 100644 --- a/src/scripts/install.sh +++ b/src/scripts/install.sh @@ -34,6 +34,9 @@ Toggle_Pager(){ if ! command -v aws >/dev/null 2>&1; then Install_AWS_CLI "${AWS_CLI_STR_AWS_CLI_VERSION}" Toggle_Pager +elif aws --version | grep "${AWS_CLI_STR_AWS_CLI_VERSION}"; then + echo "AWS CLI version ${AWS_CLI_STR_AWS_CLI_VERSION} already installed. Skipping installation" + exit 0 elif [ "$AWS_CLI_BOOL_OVERRIDE" -eq 1 ] || [ "${AWS_CLI_STR_AWS_CLI_VERSION}" != "latest" ]; then Uninstall_AWS_CLI Install_AWS_CLI "${AWS_CLI_STR_AWS_CLI_VERSION}" From 01ae3bd6c1c139f1bee061511088dca43c23771d Mon Sep 17 00:00:00 2001 From: Brian Vu Date: Wed, 29 Nov 2023 21:48:52 -0800 Subject: [PATCH 3/5] fix: remove alias --- .circleci/test-deploy.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index 9ce701b..0373dbb 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -232,10 +232,7 @@ workflows: - integration-test-install: name: integration-test-skip-install-matched-version context: [CPE_ORBS_AWS] - matrix: - alias: test-install-override-version - parameters: - executor: [ "arm" ] + executor: [ "arm" ] version: "2.1.21" install_dir: "/usr/local/aws-cli" binary_dir: "" From f34be41dd8460b686dd041902a95d9d9eef5db35 Mon Sep 17 00:00:00 2001 From: Brian Vu Date: Wed, 29 Nov 2023 23:13:48 -0800 Subject: [PATCH 4/5] fix: edit executor --- .circleci/test-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index 0373dbb..af0d0f6 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -232,7 +232,7 @@ workflows: - integration-test-install: name: integration-test-skip-install-matched-version context: [CPE_ORBS_AWS] - executor: [ "arm" ] + executor: arm version: "2.1.21" install_dir: "/usr/local/aws-cli" binary_dir: "" From d44bf32b56f27fcff6979e322db8268de58a1077 Mon Sep 17 00:00:00 2001 From: Brian Vu Date: Mon, 4 Dec 2023 20:53:43 -0800 Subject: [PATCH 5/5] fix: address pr comments --- src/scripts/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/install.sh b/src/scripts/install.sh index d13b733..3c371e1 100644 --- a/src/scripts/install.sh +++ b/src/scripts/install.sh @@ -34,7 +34,7 @@ Toggle_Pager(){ if ! command -v aws >/dev/null 2>&1; then Install_AWS_CLI "${AWS_CLI_STR_AWS_CLI_VERSION}" Toggle_Pager -elif aws --version | grep "${AWS_CLI_STR_AWS_CLI_VERSION}"; then +elif aws --version | awk '{print $2}' |grep "${AWS_CLI_STR_AWS_CLI_VERSION}"; then echo "AWS CLI version ${AWS_CLI_STR_AWS_CLI_VERSION} already installed. Skipping installation" exit 0 elif [ "$AWS_CLI_BOOL_OVERRIDE" -eq 1 ] || [ "${AWS_CLI_STR_AWS_CLI_VERSION}" != "latest" ]; then