Trigger a periodic gangway job with optional environment variable overrides
Triggers a periodic gangway job with optional environment variable overrides via REST API.
/plugin marketplace add openshift-eng/ai-helpers/plugin install ci@ai-helpers<job-name> [ENV_VAR=value ...]ci:trigger-periodic
/trigger-periodic <job-name> [ENV_VAR=value ...]
The trigger-periodic command triggers a periodic gangway job via the REST API. Periodic jobs run on a schedule but can be manually triggered for testing or urgent runs.
The command accepts:
It then constructs and executes the appropriate curl command to trigger the job via the gangway REST API.
IMPORTANT SECURITY REQUIREMENTS:
Claude is granted LIMITED and SPECIFIC access to the app.ci cluster token for the following AUTHORIZED operations ONLY:
oc whoami)Claude is EXPLICITLY PROHIBITED from:
MANDATORY USER CONFIRMATION: Before executing ANY POST operation (job trigger), Claude MUST:
Token Usage:
The app.ci cluster token is used solely for authentication with the gangway REST API. This token grants the same permissions as the authenticated user and must be handled with appropriate care. The curl_with_token.sh wrapper handles all authentication automatically.
The command performs the following steps:
Parse Arguments:
MULTISTAGE_PARAM_OVERRIDE_Construct API Request: Build the appropriate curl command using the oc-auth skill's curl wrapper:
Without overrides:
# Use curl_with_token.sh from oc-auth skill - it automatically adds the OAuth token
# app.ci cluster API: https://api.ci.l2s4.p1.openshiftapps.com:6443
curl_with_token.sh https://api.ci.l2s4.p1.openshiftapps.com:6443 -v -X POST \
-d '{"job_name": "<JOB_NAME>", "job_execution_type": "1"}' \
https://gangway-ci.apps.ci.l2s4.p1.openshiftapps.com/v1/executions
With overrides:
curl_with_token.sh https://api.ci.l2s4.p1.openshiftapps.com:6443 -v -X POST \
-d '{"job_name": "<JOB_NAME>", "job_execution_type": "1", "pod_spec_options": {"envs": {"ENV_VAR": "value"}}}' \
https://gangway-ci.apps.ci.l2s4.p1.openshiftapps.com/v1/executions
With multistage parameter override:
curl_with_token.sh https://api.ci.l2s4.p1.openshiftapps.com:6443 -v -X POST \
-d '{"job_name": "periodic-to-trigger", "job_execution_type": "1", "pod_spec_options": {"envs": {"MULTISTAGE_PARAM_OVERRIDE_FOO": "bar"}}}' \
https://gangway-ci.apps.ci.l2s4.p1.openshiftapps.com/v1/executions
The curl_with_token.sh wrapper retrieves the OAuth token from the app.ci cluster and adds it as an Authorization header automatically, without exposing the token.
Request User Confirmation: Display the complete JSON payload and curl command to the user, then explicitly ask for confirmation before proceeding. Wait for affirmative user response.
Execute Request: Only after receiving user confirmation, run the constructed curl command
Display Results: Show the API response including the execution ID
Offer Follow-up: Optionally offer to query the job status using /query-job-status
Important for Claude:
ci:oc-auth skill is loaded by invoking it with the Skill tool. The curl_with_token.sh script depends on this skill being active./query-job-statusTrigger a periodic job without overrides:
/trigger-periodic periodic-ci-openshift-release-master-ci-4.14-e2e-aws-ovn
Trigger a periodic job with payload override:
/trigger-periodic periodic-ci-openshift-release-master-ci-4.14-e2e-aws-ovn RELEASE_IMAGE_LATEST=quay.io/openshift-release-dev/ocp-release:4.18.8-x86_64
Trigger with multistage parameter override:
/trigger-periodic periodic-to-trigger MULTISTAGE_PARAM_OVERRIDE_FOO=bar
Trigger with multiple environment overrides:
/trigger-periodic periodic-ci-job RELEASE_IMAGE_LATEST=quay.io/image:4.18.8 MULTISTAGE_PARAM_OVERRIDE_TIMEOUT=3600
"1"MULTISTAGE_PARAM_OVERRIDE_ to override multistage job parameters