@@ -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 )
3626DOWNLOAD_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 "
4328unzip -o dist.zip
4429rm dist.zip
4530
@@ -56,7 +41,13 @@ tar -xzf ./spark-sdk-dist/spark-tools.tgz
5641mkdir -p /workspaces/spark-tools
5742sudo mv ./package/* /workspaces/spark-tools
5843sudo 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
6152cd /workspaces/spark-tools
6253npm 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