Commit 5027d06d authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Fix regex for getting project ids

parent c68b681b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -6,14 +6,14 @@ NS_GITLAB_HOST=$(echo $GITLAB_HOST | cut -d'/' -f3)

echo "\n------ Getting all projects IDs --------"
# Get a list of projects in the group using GitLab API
PROJECT_IDS=$(curl --header "PRIVATE-TOKEN: $1" "$GITLAB_HOST/api/v4/groups/$SPECIFICATIONS_GROUP/projects" | grep -oP '"id":(?!$SPECIFICATIONS_GROUP)\d+' | cut -d':' -f2)
PROJECT_IDS=$(curl --header "PRIVATE-TOKEN: $1" "$GITLAB_HOST/api/v4/groups/$SPECIFICATIONS_GROUP/projects" | grep -oP '"id":(?!$'SPECIFICATIONS_GROUP')\d+' | cut -d':' -f2)
echo $PROJECT_IDS

PROJECT_IDS="41" # Use TS-0019 for debugging
# Trigger pipeline for each project. Triggered pipeline pages job will handle the upgrade of the index.html
for PROJECT_ID in $PROJECT_IDS; do
	echo "------ Preparing specification project --------"
    curl -X POST --fail -F token=$ACCESS_TOKEN "https://git.onem2m.org/api/v4/projects/$PROJECT_ID/trigger/pipeline"
    curl -X POST --fail -F token=$1 https://git.onem2m.org/api/v4/projects/$PROJECT_ID/trigger/pipeline
done

exit 0
 No newline at end of file