Added AWS codecommit support using access & secret keys

This commit is contained in:
Shubham Agrawal
2021-02-05 20:02:25 +05:30
parent d2d831e671
commit b3e3302ecf
2 changed files with 38 additions and 0 deletions

View File

@ -29,6 +29,18 @@ if [[ ! -z "${DRONE_SSH_KEY}" ]]; then
ssh-keyscan -H ${DRONE_NETRC_MACHINE} > /etc/ssh/ssh_known_hosts 2> /dev/null
fi
# AWS codecommit support using AWS access key & secret key
# Refer: https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-https-unixes.html
if [[ ! -z "$DRONE_AWS_ACCESS_KEY" ]]; then
aws configure set aws_access_key_id $DRONE_AWS_ACCESS_KEY
aws configure set aws_secret_access_key $DRONE_AWS_SECRET_KEY
aws configure set default.region $DRONE_AWS_REGION
git config --global credential.helper '!aws codecommit credential-helper $@'
git config --global credential.UseHttpPath true
fi
# configure git global behavior and parameters via the
# following environment variables: