Last active
May 10, 2022 16:52
-
-
Save smparekh/a2bf43e514f65b920c8ca8fb55aaefbb to your computer and use it in GitHub Desktop.
Using CodeArtifact as Pypi mirror for Pipenv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -x AWS_PROFILE default # replace | |
set -x AWS_REGION us-east-1 # replace | |
set -x CODEARTIFACT_DOMAIN foo # replace | |
set -x CODEARTIFACT_DOMAIN_ID 123456789 # replace | |
set -x CODEARTIFACT_REPOSITORY somepypi # replace | |
function codeartifact_login | |
set -Ux CODEARTIFACT_TOKEN (aws --profile $AWS_PROFILE codeartifact get-authorization-token --domain $CODEARTIFACT_DOMAIN --domain-owner $CODEARTIFACT_DOMAIN_ID --query authorizationToken --output text) | |
set -Ux PIPENV_PYPI_MIRROR "https://aws:$CODEARTIFACT_TOKEN@$CODEARTIFACT_DOMAIN-$CODEARTIFACT_DOMAIN_ID.d.codeartifact.$AWS_REGION.amazonaws.com/pypi/$CODEARTIFACT_REPOSITORY/simple/" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment