On CircleCI Server, a schedule in .circleci/config.yml can trigger a pipeline for a GitHub project or a Bitbucket project. A schedule trigger on the project Triggers page is not part of Server. A GitLab project has neither kind of schedule.
Use a schedule in config
Add the schedule on the workflow in config. Server registers that schedule and triggers a pipeline when it fires. The same limits apply as on Cloud:
The project needs at least one follower with a valid login. See Scheduled Workflow Stopped Running With No Config Changes.
A setup workflow (
setup: true) is not triggered by that schedule. Server ignores the schedule. See Support for Scheduled Workflows in Dynamic Configurations.
GitLab is outside this path on Server and on Cloud.
Trigger a pipeline from your own scheduler
Call the pipeline API on a timer in these cases:
The pipeline is a setup workflow.
The pipeline expects pipeline parameters.
The project is on GitLab.
A Kubernetes CronJob can send the request. A second project can send it too, if that second project is GitHub or Bitbucket and already has a config schedule.
The token needs permission to trigger pipelines on the target project. Replace <server-host> with the Server hostname. Replace <project-slug> with the slug from Project Settings, for example gh/<org>/<repo>.
curl -sS -X POST \
-H "Circle-Token: $CIRCLE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"branch":"main"}' \
"https:///api/v2/project//pipeline"
CircleCI triggers a normal pipeline from that request. Setup workflows work. Add a parameters object next to branch when the pipeline expects parameters.
