Skip to content

Commit a9334c7

Browse files
Update devcon
1 parent e960cee commit a9334c7

File tree

1 file changed

+16
-33
lines changed

1 file changed

+16
-33
lines changed

.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/216808806)
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"

0 commit comments

Comments
 (0)