[neon/ubuntu-core/models.add-model-autocommit-script] /: Improve readability
Antoine Gonzalez
null at kde.org
Wed Oct 2 10:01:40 BST 2024
Git commit 441bd527724f632c58d75dc4251e59ebf6513f16 by Antoine Gonzalez.
Committed on 02/10/2024 at 09:01.
Pushed by daspood into branch 'models.add-model-autocommit-script'.
Improve readability
M +9 -3 update-models.sh
https://invent.kde.org/neon/ubuntu-core/-/commit/441bd527724f632c58d75dc4251e59ebf6513f16
diff --git a/update-models.sh b/update-models.sh
index b566734..583f2d2 100755
--- a/update-models.sh
+++ b/update-models.sh
@@ -9,7 +9,10 @@ REF=`git branch --show-current`
# Fetch Pipeline ID
-if pipeline_id=`curl -s -f "https://invent.kde.org/api/v4/projects/17308/pipelines" | jq -e "[.[] | select(.ref == \"$REF\")][0].id"`
+pipeline_id=`curl -s -f "https://invent.kde.org/api/v4/projects/17308/pipelines" | jq -e "[.[] | select(.ref == \"$REF\")][0].id"`
+success=$?
+
+if [ $success -eq 0 ]
then
job_url="https://invent.kde.org/api/v4/projects/17308/pipelines/$pipeline_id/jobs?scope[]=success"
echo "Using pipeline #$pipeline_id - job url: $job_url"
@@ -20,7 +23,10 @@ fi
# Fetch Job ID
-if job_id=`curl -s -f "$job_url" | jq -e '.[] | select(.name == "neon_core_models") | .id'`
+job_id=`curl -s -f "$job_url" | jq -e '.[] | select(.name == "neon_core_models") | .id'`
+success=$?
+
+if [ $success -eq 0 ]
then
artifacts_url="https://invent.kde.org/api/v4/projects/17308/jobs/$job_id/artifacts"
echo "Using job #$job_id - artifacts url: $artifacts_url"
@@ -32,7 +38,7 @@ fi
# Fetch Job Artefact, Unpack & Commit
curl -s --location --output "$SCRIPT_DIR/Signed_models.zip" "$artifacts_url"
-unzip "$SCRIPT_DIR/Signed_models.zip" -d "$SCRIPT_DIR/Signed_models"
+unzip -qq "$SCRIPT_DIR/Signed_models.zip" -d "$SCRIPT_DIR/Signed_models"
success=$?
if [ $success -eq 0 ]
More information about the Neon-commits
mailing list