Skip to content

Commit 2ca60f1

Browse files
authored
Merge pull request #11 from CryoInTheCloud/tsnow03-patch-1
Add Google Cloud CLI installation to postBuild script
2 parents af2610f + c97bd9e commit 2ca60f1

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎.binder/postBuild‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,26 @@ platform="linux-x64"
1414
curl -fsSL https://github.com/anomalyco/opencode/releases/download/${OPENCODE_VERSION}/opencode-${platform}.tar.gz | tar -xzv -C "${NB_PYTHON_PREFIX}/bin"
1515
test -f "${NB_PYTHON_PREFIX}/bin/opencode"
1616

17+
# Google Cloud CLI (gcloud, gsutil, bq) — pinned, installed outside $HOME
18+
# so it isn't wiped when the real user filesystem mounts at hub spin-up.
19+
GCLOUD_VERSION=580.0.0
20+
mkdir -p "${NB_PYTHON_PREFIX}/opt"
21+
curl -fsSL "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-${GCLOUD_VERSION}-linux-x86_64.tar.gz" \
22+
| tar -xz -C "${NB_PYTHON_PREFIX}/opt"
23+
24+
"${NB_PYTHON_PREFIX}/opt/google-cloud-sdk/install.sh" \
25+
--quiet \
26+
--path-update=false \
27+
--command-completion=false \
28+
--usage-reporting=false
29+
30+
for bin in gcloud gsutil bq; do
31+
ln -sf "${NB_PYTHON_PREFIX}/opt/google-cloud-sdk/bin/${bin}" "${NB_PYTHON_PREFIX}/bin/${bin}"
32+
done
33+
34+
test -x "${NB_PYTHON_PREFIX}/bin/gcloud"
35+
gcloud version
36+
1737
# Put our custom Jupyter Server config into appropriate platform
1838
# This path is determined by looking at output of `jupyter --path` in the hub
1939
# We copy both to notebook server config and jupyter server config, because either can be

0 commit comments

Comments
 (0)