mirror of
https://github.com/AeThex-Corporation/AeThex-OS.git
synced 2026-04-17 22:07:20 +00:00
Add trigger script for GitLab CI pipeline
This commit is contained in:
parent
4a089ad133
commit
cfc5b01b0e
1 changed files with 36 additions and 0 deletions
36
trigger-gitlab-pipeline.sh
Executable file
36
trigger-gitlab-pipeline.sh
Executable file
|
|
@ -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
|
||||
Loading…
Reference in a new issue