Comments (6)
I think the orb could really benefit from some additional Windows tests!
from aws-cli-orb.
Hey @jenny-miggin and @Ian-Rowland-i2,
Thanks for bringing this to our attention. I have a fix in place and some extra testing as well in #174.
If there are other test cases you can think of, let me know and I'd be happy to add them as well!
Best,
Brian
from aws-cli-orb.
According to the @orb.yml, the latest version of the orb should only used to install version 2.
So not sure why code is present to distinguish between version 1 and version 2 paths.
This could be accomplished by updating install.sh to include the following code:
# Only support AWS CLI V2
if echo "${AWS_CLI_STR_AWS_CLI_VERSION}" | grep -q "^1\."; then
echo "AWS CLI V1 (v${AWS_CLI_STR_AWS_CLI_VERSION}) is not supported."
exit 1
fi
This would obviate the need for the logic distinguishing between the two paths as only version 2 would be accepted.
If this is not possible then the Windows version of the install.sh, should be updated, as the grep statement in its current form will allow, for example, version 1.24.0 to be installed but will be assigned the Version 2 path!
This is because grep -e "2." will match the number '2' and any next character within the whole string. i.e.
echo "1.24.0" | grep -e "2." -e "latest"
echo "1.16.213" | grep -e "2." -e "latest"
echo "2.1.33" | grep -e "2." -e "latest"
will all match.
The correct expression is "^2\." - this will ensure that versions beginning with "2", followed by a '.' will match. This will eliminate the first two versions numbers (1.24.0 and 1.16.213) from being matched.
from aws-cli-orb.
Also noted that the tests that override with the latest versions (integration-test-install-override-version-with-latest-*) assume that because a version has been installed that the latest version has been installed., whereas it should verify that it is the case.
This can accomplished using the following code to obtain the latest available version of the AWS CLI and comparing it to the version installed:
# Fetches the latest available AWS Command Line Interface (AWS CLI) version from either chocolatey.org for Windows executors
# or from the official AWS CLI GitHub repository's CHANGELOG file.
#
# Returns:
# # - The latest available AWS CLI version in 'x.y.z' format.
function get_latest_available_aws_cli_version() {
# shellcheck disable=SC2005 # This syntax results in exactly the desired output
if is_choco_installed; then
echo "$(choco find awscli --exact --page-size=1 --limit-output --source=chocolatey | tail -n1 | cut -d'|' -f2)"
else
# Otherwise, interrogate the AWS CLI changelog for the latest version.
# N.B The following commands fail (to run on non-Windows executors):
# latest_version="$(curl -s https://raw.githubusercontent.com/aws/aws-cli/v2/CHANGELOG.rst | grep -oEm 1 '[0-9]+\.[0-9]+\.[0-9]+')" - gives error status 23
# latest_version="$(curl -s https://raw.githubusercontent.com/aws/aws-cli/v2/CHANGELOG.rst | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -n 1)" give error status 141
# See https://stackoverflow.com/a/19120674 for more details
echo "$(curl -s https://raw.githubusercontent.com/aws/aws-cli/v2/CHANGELOG.rst)" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | sed -n 1p
fi
}
from aws-cli-orb.
Also, the Windows code (and the non-Windows code), always uninstall the existing CLI before installing the specified version.
This means that if the specified version is already installed, it is uninstalled (unnecessarily) and then (re)installed, when in fact it should be a NO-OP!
The code should check if the specified version is installed and do nothing if it is.
from aws-cli-orb.
Finally, the Toggle_Pager code is only run if the AWS CLI was initially absent or if another version is being installed.
If an existing version of the AWS CLI is present the TogglePager code is not run meaning the disable_aws_pager argument is effectively ignored.
from aws-cli-orb.
Related Issues (20)
- 'role_arn' IS a required argument when calling 'aws-cli/setup' HOT 2
- circleci/[email protected] fails on aws-cli/setup - Error relocating /usr/bin/curl (alpine)
- Generate shortlived AWS Keys using CircleCI OIDC token fails
- Grep statement in install.sh (Windows) can cause wrong path to be added HOT 1
- 'disable_aws_pager' argument ignored if AWS CLI is already installed
- Enhance Installation Flow for Existing CLI Versions
- multiple calls to setup don't use newest role
- Broken AWS Credentials after #164 (4.1.2) HOT 8
- The documentation on aws sts assume-role is incorrect / not working in real world scenarios HOT 2
- Incorrect Version Check in Installation Script (install.sh) when using 'latest'
- Extra hyphen at the end of role_session_name HOT 1
- upgrade glibc from 2.34-r0 to 2.35-r1 to resolve nsswitch cannot be overwrriten issue
- /tmp/default.keys: No such file or directory HOT 3
- OICD AWS Provider - Old AWS orb version not consistent with > 4.0 version causing issues with AWS Credentials configuration HOT 1
- `setup` command fails with OIDC role while `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` are set in the environment HOT 5
- Unable to use a dynamic `role_arn` with `assume_role_with_web_identity` command HOT 1
- Permission Denied for $BASH_ENV in v4.1.3
- setup not creating fully up to date credentials file
- aws-cli/install step fails using [email protected] on xcode 15.4.0 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-cli-orb.