Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed install script to make it compatible for sh on linux #457

Merged
merged 3 commits into from
Oct 26, 2023

Conversation

amp-powell
Copy link
Contributor

@amp-powell amp-powell commented Oct 25, 2023

The PR changes the syntax of the credprovider install script to make it compatible with shell.
Fixes bug #2100273 and this bug #450

@JohnSchmeichel
Copy link
Member

Works with default options, but if I set AZURE_ARTIFACTS_CREDENTIAL_PROVIDER_VERSION then I get errors:

export AZURE_ARTIFACTS_CREDENTIAL_PROVIDER_VERSION=v1.1.0-alpha
sh -c "$(curl -fsSL https://raw.githubusercontent.com/microsoft/artifacts-credprovider/ba93b5218249ec3792470f9b2f48c91bd930a016/helpers/installcredprovider.sh)"

still gives me an error sh: 19: [: v1.1.0-alpha: unexpected operator

helpers/installcredprovider.sh Outdated Show resolved Hide resolved
@phil-hodgson
Copy link
Member

If we're making this work for environments without bash, should we also update the file's shebang?

@ksigmund
Copy link
Contributor

If we're making this work for environments without bash, should we also update the file's shebang?

Is our posture to support the lowest common denominator?

@phil-hodgson
Copy link
Member

The issue customers faced is that on some environments, the customer had to first install bash before they could get the cred provider installed. The installation script should work whether bash is available or not.

if [ ! -z ${AZURE_ARTIFACTS_CREDENTIAL_PROVIDER_VERSION} ] && [ ${AZURE_ARTIFACTS_CREDENTIAL_PROVIDER_VERSION} == 0.* ] || [ "$AZURE_ARTIFACTS_CREDENTIAL_PROVIDER_VERSION" = "v0.*" ]; then
echo "ERROR: To install NET6 cred provider using the USE_NET6_ARTIFACTS_CREDENTIAL_PROVIDER variable, version to be installed must be 1.0.0. or greater. Check your AZURE_ARTIFACTS_CREDENTIAL_PROVIDER_VERSION variable."
exit 1
if [ ! -z ${AZURE_ARTIFACTS_CREDENTIAL_PROVIDER_VERSION} ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should be able to remove this entirely, as if it's null it will just drop through the case

@amp-powell amp-powell merged commit d6aba72 into master Oct 26, 2023
2 checks passed
@amp-powell amp-powell deleted the users/abpowell/make-script-sh-compatible branch October 26, 2023 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants