fix deploy
Some checks failed
/ lint (pull_request) Successful in 28s
/ build-edge (pull_request) Successful in 1m25s
/ deploy-edge (pull_request) Failing after 30s

This commit is contained in:
Antoine Martin 2024-08-16 00:58:31 -04:00
parent b739869140
commit d4522ca45e
Signed by: forge
GPG key ID: D62A472A4AA7D541

View file

@ -5,21 +5,22 @@ set -eu -o pipefail
readonly BASEBRANCH=$(grep PRETTY_NAME /etc/os-release | awk '{print $3}' | tr -d '"') readonly BASEBRANCH=$(grep PRETTY_NAME /etc/os-release | awk '{print $3}' | tr -d '"')
readonly TARGET_REPO=$CI_ALPINE_REPO readonly TARGET_REPO=$CI_ALPINE_REPO
readonly QUBES_REL=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
apkgs=$(find package -type f -name "*.apk") apkgs=$(find package -type f -name "*.apk")
for apk in $apkgs; do for apk in $apkgs; do
branch=$(echo $apk | awk -F '/' '{print $2}')
arch=$(echo $apk | awk -F '/' '{print $3}') arch=$(echo $apk | awk -F '/' '{print $3}')
name=$(echo $apk | awk -F '/' '{print $4}') name=$(echo $apk | awk -F '/' '{print $4}')
echo "Sending $name of arch $arch to $TARGET_REPO/$BASEBRANCH/$branch" echo "Sending $name of arch $arch to $TARGET_REPO/$BASEBRANCH/qubes-$QUBES_REL"
return=$(curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN --upload-file $apk $TARGET_REPO/$BASEBRANCH/$branch 2>&1) return=$(curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN --upload-file $apk $TARGET_REPO/$BASEBRANCH/qubes-$QUBES_REL 2>&1)
echo $return echo $return
if [ "$return" == "package file already exists" ]; then if [ "$return" == "package file already exists" ]; then
echo "Package already exists, refreshing..." echo "Package already exists, refreshing..."
curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN -X DELETE $TARGET_REPO/$BASEBRANCH/$branch/$arch/$name curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN -X DELETE $TARGET_REPO/$BASEBRANCH/qubes-$QUBES_REL/$arch/$name
curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN --upload-file $apk $TARGET_REPO/$BASEBRANCH/$branch curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN --upload-file $apk $TARGET_REPO/$BASEBRANCH/qubes-$QUBES_REL
fi fi
done done