fix deploy
This commit is contained in:
parent
b739869140
commit
d4522ca45e
1 changed files with 6 additions and 5 deletions
|
@ -5,21 +5,22 @@ set -eu -o pipefail
|
|||
|
||||
readonly BASEBRANCH=$(grep PRETTY_NAME /etc/os-release | awk '{print $3}' | tr -d '"')
|
||||
readonly TARGET_REPO=$CI_ALPINE_REPO
|
||||
readonly QUBES_REL=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
|
||||
|
||||
|
||||
apkgs=$(find package -type f -name "*.apk")
|
||||
|
||||
for apk in $apkgs; do
|
||||
branch=$(echo $apk | awk -F '/' '{print $2}')
|
||||
arch=$(echo $apk | awk -F '/' '{print $3}')
|
||||
name=$(echo $apk | awk -F '/' '{print $4}')
|
||||
|
||||
echo "Sending $name of arch $arch to $TARGET_REPO/$BASEBRANCH/$branch"
|
||||
return=$(curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN --upload-file $apk $TARGET_REPO/$BASEBRANCH/$branch 2>&1)
|
||||
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/qubes-$QUBES_REL 2>&1)
|
||||
echo $return
|
||||
if [ "$return" == "package file already exists" ]; then
|
||||
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 --upload-file $apk $TARGET_REPO/$BASEBRANCH/$branch
|
||||
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/qubes-$QUBES_REL
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
Loading…
Reference in a new issue