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

Cache git credentials in init.sh #202

Merged
merged 3 commits into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion azure/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@
"settings": {
"commandToExecute": "[concat('sh init.sh ', copyIndex(), ' ', variables('numberOfInstances'), ' ', variables('storageAcctName'), ' ', listKeys(variables('storageAcctName'),'2017-10-01').keys[0].value, ' ', parameters('branchName'))]",
"fileUris": [
"https://raw.githubusercontent.com/citusdata/test-automation/master/azure/init.sh"
"https://raw.githubusercontent.com/citusdata/test-automation/master/azure/init.sh",
"https://raw.githubusercontent.com/citusdata/test-automation/master/hammerdb/cache_git_creds.sh"
]
}
},
Expand Down
3 changes: 3 additions & 0 deletions azure/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,6 @@ find_private_ips() {
}

find_private_ips "$@"

# cache git credentials so that we can clone a private repository with caching enabled
./cache_git_creds.sh
4 changes: 3 additions & 1 deletion hammerdb/cache_git_creds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ GIT_TOKEN=$(</tmp/git_token)

git config --global credential.helper store
cd $HOME
# remove .dummy if it exists
rm -rf .dummy
mkdir -p .dummy
cd .dummy
# this is to cache github username and token so that later usages wont ask for username password
git clone https://${GIT_USERNAME}:${GIT_TOKEN}@github.com/citusdata/release-test-results
git clone https://${GIT_USERNAME}:${GIT_TOKEN}@github.com/citusdata/release-test-results --single-branch

EOSU

Expand Down