Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/dev/preview/workflow/lib/ensure-gcloud-auth.sh
2500 views
1
#!/usr/bin/env bash
2
3
# this script is meant to be sourced
4
5
function ensure_gcloud_auth() {
6
if [[ $(gcloud auth list --format=json) == '[]' ]]; then
7
echo
8
echo "Currently you need to be authenticated with gcloud to run the build"
9
echo
10
echo "This is needed to you can use the Leeway build cache that Werft also uses"
11
echo "We're working on automating this here: https://github.com/gitpod-io/gitpod/issues/13714"
12
echo
13
echo "But for now you have to run the following log in manually"
14
echo
15
gcloud auth login --no-launch-browser
16
echo
17
echo "Great, thanks!"
18
echo
19
echo "Continuing the build"
20
fi
21
}
22
23