Trigger a pipeline via the API

Start a pipeline from outside CI with a trigger token and your own variables

curl -X POST -F token=$CI_TOKEN -F ref=main -F 'variables[DEPLOY]=true' https://<host>/api/v4/projects/<id>/trigger/pipeline

tool
gitlab-ci4 commands
tags
gitlab-cicigitops

More gitlab-ci commands

  • gitlab-ci-local --job build

    Run a job from .gitlab-ci.yml locally in Docker. It replaces the removed gitlab-runner exec

  • gitlab-runner register --non-interactive --url https://<host> --token glrt-<id> --executor docker --docker-image alpine:latest

    Register a runner with the new authentication token. Note: the old registration token is deprecated

  • gitlab-runner verify --delete

    Check the configured runners and unregister the ones GitLab no longer knows

all 4 gitlab-ci commands