Skip to content

Commit 32bd467

Browse files
Update dev container to point at new release (#16)
1 parent 3b2208a commit 32bd467

File tree

3 files changed

+19
-48
lines changed

3 files changed

+19
-48
lines changed

.devcontainer/devcontainer.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,6 @@
2323
"ghcr.io/devcontainers/features/sshd:1": {
2424
"version": "latest"
2525
}
26-
},
27-
"customizations": {
28-
"codespaces": {
29-
"repositories": {
30-
"github/gh-runtime-cli": {
31-
"permissions": {
32-
"contents": "read",
33-
"packages": "read"
34-
}
35-
}
36-
}
37-
}
3826
}
3927
}
4028

.devcontainer/onCreate.sh

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,19 @@ echo "Installing the GitHub CLI"
1212
&& sudo apt update \
1313
&& sudo apt install gh inotify-tools -y
1414

15-
echo "Installing the GitHub CLI Runtime extension"
16-
# if the GITHUB_USER is monalisa, then install the plugin from the local folder
17-
if [ "$GITHUB_USER" = "monalisa" ]; then
18-
cd ./gh-runtime-cli
19-
gh extension install .
20-
else
21-
gh extension install github/gh-runtime-cli
22-
fi
23-
24-
echo "Adding an alias for the GitHub CLI Runtime extension"
25-
gh alias set runtime runtime-cli
26-
27-
echo "Downloading the latest release of workbench-template from GitHub"
15+
echo "Installing azcopy"
2816

29-
GITHUB_PAT="$RELEASE_PAT"
30-
REPO="github/workbench-template"
17+
sudo wget -O /usr/local/bin/azcopytar https://aka.ms/downloadazcopy-v10-linux
18+
sudo tar -xvf /usr/local/bin/azcopytar -C /usr/local/bin/
19+
sudo rm /usr/local/bin/azcopytar
20+
azcopy_dir=$(find /usr/local/bin/ -type d -name "azcopy*" | head -n 1)
21+
sudo mv "$azcopy_dir/azcopy" /usr/local/bin/azcopy
22+
sudo rm -rf "$azcopy_dir"
3123

32-
# Fetch the latest release information
33-
LATEST_RELEASE=$(curl -s -H "Authorization: token $GITHUB_PAT" https://api.github.com/repos/$REPO/releases/latest)
3424

35-
# Extract the first browser_download_url from the assets
25+
LATEST_RELEASE=$(curl -s -H "Authorization: token $TEMPLATE_PAT" https://api.github.com/repos/github/spark-template/releases/latest)
3626
DOWNLOAD_URL=$(echo "$LATEST_RELEASE" | jq -r '.assets[0].url')
37-
echo "Download URL: $DOWNLOAD_URL"
38-
39-
40-
# Fetch the latest release information
41-
curl -L -o dist.zip -H "Authorization: token $GITHUB_PAT" -H "Accept: application/octet-stream" "$DOWNLOAD_URL"
42-
27+
curl -L -o dist.zip -H "Authorization: token $TEMPLATE_PAT" -H "Accept: application/octet-stream" "$DOWNLOAD_URL"
4328
unzip -o dist.zip
4429
rm dist.zip
4530

@@ -56,7 +41,13 @@ tar -xzf ./spark-sdk-dist/spark-tools.tgz
5641
mkdir -p /workspaces/spark-tools
5742
sudo mv ./package/* /workspaces/spark-tools
5843
sudo rmdir ./package
59-
rm -rf ./spark-sdk-dist
44+
45+
sudo mv spark-sdk-dist/gh-spark-cli /usr/local/bin/
46+
cd /usr/local/bin/gh-spark-cli
47+
gh extension install .
48+
gh alias set spark spark-cli
49+
50+
rm -rf /workspaces/spark-template/spark-sdk-dist
6051

6152
cd /workspaces/spark-tools
6253
npm i
@@ -65,11 +56,3 @@ npm i -f /workspaces/spark-tools
6556

6657

6758

68-
echo "Installing azcopy"
69-
70-
sudo wget -O /usr/local/bin/azcopytar https://aka.ms/downloadazcopy-v10-linux
71-
sudo tar -xvf /usr/local/bin/azcopytar -C /usr/local/bin/
72-
sudo rm /usr/local/bin/azcopytar
73-
azcopy_dir=$(find /usr/local/bin/ -type d -name "azcopy*" | head -n 1)
74-
sudo mv "$azcopy_dir/azcopy" /usr/local/bin/azcopy
75-
sudo rm -rf "$azcopy_dir"

deploy.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ fi
3838

3939
echo "Deploying as ${GITHUB_USER} to ${GITHUB_RUNTIME_PERMANENT_NAME}"
4040

41-
gh runtime create \
41+
gh spark create \
4242
--app ${GITHUB_RUNTIME_PERMANENT_NAME} \
4343
--env "GITHUB_RUNTIME_PERMANENT_NAME=${GITHUB_RUNTIME_PERMANENT_NAME}" \
4444
--secret "GITHUB_TOKEN=${GITHUB_TOKEN}" \
4545

46-
gh runtime deploy \
46+
gh spark deploy \
4747
--app ${GITHUB_RUNTIME_PERMANENT_NAME} \
4848
--dir dist
4949

50-
DEPLOYED_URL="$(gh runtime get --app ${GITHUB_RUNTIME_PERMANENT_NAME})"
50+
DEPLOYED_URL="$(gh spark get --app ${GITHUB_RUNTIME_PERMANENT_NAME})"
5151

5252
echo "[--URL-App=[https://${DEPLOYED_URL}]--]"
5353
echo "[--Deployment: Complete--]"

0 commit comments

Comments
 (0)