Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 27b686e

Browse files
Change snapcraft to read base url from buildinfo
1 parent 6518f93 commit 27b686e

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

lts/snap/snapcraft.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,26 @@ parts:
5252
snapcraftctl set-grade "stable"
5353
override-build: |
5454
file="./version.txt"
55+
buildinfo=$(curl -s -L https://aka.ms/pwsh-buildinfo-7-4)
56+
baseurl=$(echo $buildinfo | jq -r .BaseUrl)
5557
if [ -f "$file" ]
5658
then
5759
echo "using version file"
5860
version=$(cat $file)
5961
else
6062
echo "getting latest version from GitHub"
61-
version=$(curl -s -L https://aka.ms/pwsh-buildinfo-7-4| jq -r .ReleaseTag | sed 's/v//')
63+
version=$(echo $buildinfo | jq -r .ReleaseTag | sed 's/v//')
6264
echo "Writing version to file"
6365
echo $version > $file
6466
fi
65-
container=$(echo v$version| sed 's/\./-/g')
66-
echo "getting powershell $version - $container"
67-
# These urls are subject to change.
67+
echo "getting powershell $version - $baseurl/v$version"
6868
case "$SNAPCRAFT_ARCH_TRIPLET" in
6969
aarch64-linux-gnu)
70-
curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-arm64.tar.gz ;;
70+
curl -L -o powershell.tar.gz $baseurl/v$version/powershell-$version-linux-arm64.tar.gz ;;
7171
arm-linux-gnueabihf)
72-
curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-arm32.tar.gz ;;
72+
curl -L -o powershell.tar.gz $baseurl/v$version/powershell-$version-linux-arm32.tar.gz ;;
7373
x86_64-linux-gnu)
74-
curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-x64.tar.gz ;;
74+
curl -L -o powershell.tar.gz $baseurl/v$version/powershell-$version-linux-x64.tar.gz ;;
7575
*)
7676
# fail because we don't have a build for the requested platform
7777
echo "The $SNAPCRAFT_ARCH_TRIPLET platform does not have an available build. Exiting."

preview/snap/snapcraft.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,26 @@ parts:
5050
snapcraftctl set-grade "stable"
5151
override-build: |
5252
file="./version.txt"
53+
buildinfo=$(curl -s -L https://aka.ms/pwsh-buildinfo-preview)
54+
baseurl=$(echo $buildinfo | jq -r .BaseUrl)
5355
if [ -f "$file" ]
5456
then
5557
echo "using version file"
5658
version=$(cat $file)
5759
else
5860
echo "getting latest version from GitHub"
59-
version=$(curl -s -L https://aka.ms/pwsh-buildinfo-preview | jq -r .ReleaseTag | sed 's/v//')
61+
version=$(echo $buildinfo | jq -r .ReleaseTag | sed 's/v//')
6062
echo "Writing version to file"
6163
echo $version > $file
6264
fi
63-
container=$(echo v$version| sed 's/\./-/g')
64-
echo "getting powershell $version - $container"
65-
# These urls are subject to change.
65+
echo "getting powershell $version - $baseurl/v$version"
6666
case "$SNAPCRAFT_ARCH_TRIPLET" in
6767
aarch64-linux-gnu)
68-
curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-arm64.tar.gz ;;
68+
curl -L -o powershell.tar.gz $baseurl/v$version/powershell-$version-linux-arm64.tar.gz ;;
6969
arm-linux-gnueabihf)
70-
curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-arm32.tar.gz ;;
70+
curl -L -o powershell.tar.gz $baseurl/v$version/powershell-$version-linux-arm32.tar.gz ;;
7171
x86_64-linux-gnu)
72-
curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-x64.tar.gz ;;
72+
curl -L -o powershell.tar.gz $baseurl/v$version/powershell-$version-linux-x64.tar.gz ;;
7373
*)
7474
# fail because we don't have a build for the requested platform
7575
echo "The $SNAPCRAFT_ARCH_TRIPLET platform does not have an available build. Exiting."

stable/snap/snapcraft.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,26 @@ parts:
5252
snapcraftctl set-grade "stable"
5353
override-build: |
5454
file="./version.txt"
55+
buildinfo=$(curl -s -L https://aka.ms/pwsh-buildinfo-7-4)
56+
baseurl=$(echo $buildinfo | jq -r .BaseUrl)
5557
if [ -f "$file" ]
5658
then
5759
echo "using version file"
5860
version=$(cat $file)
5961
else
6062
echo "getting latest version from GitHub"
61-
version=$(curl -s -L https://aka.ms/pwsh-buildinfo-7-4| jq -r .ReleaseTag | sed 's/v//')
63+
version=$(echo $buildinfo | jq -r .ReleaseTag | sed 's/v//')
6264
echo "Writing version to file"
6365
echo $version > $file
6466
fi
65-
container=$(echo v$version| sed 's/\./-/g')
66-
echo "getting powershell $version - $container"
67-
# These urls are subject to change.
67+
echo "getting powershell $version - $baseurl/v$version"
6868
case "$SNAPCRAFT_ARCH_TRIPLET" in
6969
aarch64-linux-gnu)
70-
curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-arm64.tar.gz ;;
70+
curl -L -o powershell.tar.gz $baseurl/v$version/powershell-$version-linux-arm64.tar.gz ;;
7171
arm-linux-gnueabihf)
72-
curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-arm32.tar.gz ;;
72+
curl -L -o powershell.tar.gz $baseurl/v$version/powershell-$version-linux-arm32.tar.gz ;;
7373
x86_64-linux-gnu)
74-
curl -L -o powershell.tar.gz https://pscoretestdata.blob.core.windows.net/$container/powershell-$version-linux-x64.tar.gz ;;
74+
curl -L -o powershell.tar.gz $baseurl/v$version/powershell-$version-linux-x64.tar.gz ;;
7575
*)
7676
# fail because we don't have a build for the requested platform
7777
echo "The $SNAPCRAFT_ARCH_TRIPLET platform does not have an available build. Exiting."

0 commit comments

Comments
 (0)