From cfc5b01b0ea0310306528fc880707f236f1d2733 Mon Sep 17 00:00:00 2001 From: MrPiglr <31398225+MrPiglr@users.noreply.github.com> Date: Sat, 27 Dec 2025 22:09:07 +0000 Subject: [PATCH] Add trigger script for GitLab CI pipeline --- trigger-gitlab-pipeline.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 trigger-gitlab-pipeline.sh diff --git a/trigger-gitlab-pipeline.sh b/trigger-gitlab-pipeline.sh new file mode 100755 index 0000000..e757e69 --- /dev/null +++ b/trigger-gitlab-pipeline.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Trigger GitLab CI pipeline for AeThex-OS ISO build +# Usage: ./trigger-gitlab-pipeline.sh [branch] [token] +# Defaults: branch=main, token=$GITLAB_TOKEN + +BRANCH="${1:-main}" +TOKEN="${2:-${GITLAB_TOKEN:-}}" + +if [ -z "$TOKEN" ]; then + echo "❌ GITLAB_TOKEN not set and no token provided as argument." + echo "Usage: $0 [branch] [token]" + echo "Or export GITLAB_TOKEN=your_token_here" + exit 1 +fi + +PROJECT_ID="MrPiglr%2FAeThex-OS" # URL-encoded namespace/project +GITLAB_URL="https://gitlab.com/api/v4" + +echo "🚀 Triggering GitLab pipeline on branch: $BRANCH" + +RESPONSE=$(curl -s -X POST \ + "${GITLAB_URL}/projects/${PROJECT_ID}/pipeline" \ + -H "PRIVATE-TOKEN: $TOKEN" \ + -d "ref=${BRANCH}") + +echo "$RESPONSE" | jq . || echo "$RESPONSE" + +PIPELINE_ID=$(echo "$RESPONSE" | jq -r '.id // empty') +if [ -n "$PIPELINE_ID" ]; then + echo "✅ Pipeline #$PIPELINE_ID created" + echo "📊 View at: https://gitlab.com/MrPiglr/AeThex-OS/-/pipelines/$PIPELINE_ID" +else + echo "⚠️ No pipeline ID returned; check your token and project access." +fi