[ci] Fix the generating version file failure issue caused by artifacts folder change (#7464) (#10451)

Fix the generating version file failure issue caused by artifacts folder change.
When changing to use the same template for PR build, official build and packages version upgrade, the artifacts folder adding a "target" folder, the version upgrade task should be changed accordingly.
This commit is contained in:
xumia 2022-04-02 22:37:34 +08:00 committed by xumia
parent 9008132871
commit c4f65f6f60

View File

@ -80,14 +80,14 @@ stages:
default_platform=broadcom default_platform=broadcom
artifacts=$(find $(Pipeline.Workspace) -maxdepth 1 -type d -name 'sonic-buildimage.*' | grep -v "sonic-buildimage.${default_platform}") artifacts=$(find $(Pipeline.Workspace) -maxdepth 1 -type d -name 'sonic-buildimage.*' | grep -v "sonic-buildimage.${default_platform}")
echo "artifacts$artifacts" echo "artifacts$artifacts"
cp -r $(Pipeline.Workspace)/sonic-buildimage.${default_platform}/versions target/ cp -r $(Pipeline.Workspace)/sonic-buildimage.${default_platform}/target/versions target/
make freeze FREEZE_VERSION_OPTIONS=-r make freeze FREEZE_VERSION_OPTIONS=-r
find files/build/versions find files/build/versions
ordered_artifacts=$(echo "$artifacts" | grep -v -E "arm64|armhf" && echo "$artifacts" | grep -E "arm64|armhf") ordered_artifacts=$(echo "$artifacts" | grep -v -E "arm64|armhf" && echo "$artifacts" | grep -E "arm64|armhf")
for artifact in $ordered_artifacts for artifact in $ordered_artifacts
do do
rm -rf target/versions rm -rf target/versions
cp -r $artifact/versions target/ cp -r $artifact/target/versions target/
OPTIONS="-a -d" OPTIONS="-a -d"
[[ "$artifact" == *arm64* || "$artifact" == *armhf* ]] && OPTIONS="-d" [[ "$artifact" == *arm64* || "$artifact" == *armhf* ]] && OPTIONS="-d"
make freeze FREEZE_VERSION_OPTIONS="$OPTIONS" make freeze FREEZE_VERSION_OPTIONS="$OPTIONS"