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

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 2021-04-29 07:01:07 +08:00 committed by GitHub
parent 83e23801fd
commit 0472323860
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,14 +73,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"