LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

glab-schedule

Manage GitLab CI/CD pipeline schedules

TLDR

List schedules in the current repository
$ glab schedule list
copy
List schedules in another repository
$ glab schedule list --repo [owner]/[repository]
copy
Create a schedule
$ glab schedule create --cron "0 * * * *" --description "Hourly build" --ref main
copy
Create a schedule with variables
$ glab schedule create --cron "0 0 * * *" --description "Nightly" --ref main --variable "KEY:value"
copy
Run a schedule now
$ glab schedule run [schedule_id]
copy
Change the cron expression
$ glab schedule update [schedule_id] --cron "0 * * * *"
copy
Delete a schedule
$ glab schedule delete [schedule_id]
copy

SYNOPSIS

glab schedule command [flags]

DESCRIPTION

glab schedule manages GitLab CI/CD pipeline schedules for the current Git repository, or for the project named with --repo. Aliases are sched and skd.A schedule stores a cron expression, a ref, a description, and optional variables. run starts one extra pipeline and does not change the next cron time.

PARAMETERS

-R, --repo owner/repository

Act on another project. A full Git URL is also accepted. Inherited by every subcommand.
--cron expression
Cron recurrence, five fields.
--ref branch-or-tag
Git ref the pipeline runs against.
--description text
Label stored with the schedule.
--active
On create, the schedule is active unless this is set false. On update, omitting it leaves the current state.

SUBCOMMANDS

list

List pipeline schedules. --output json prints JSON. --page and --per-page page the list.
create
Create a schedule. --cron, --description, and --ref are required. --variable may be repeated as `key:value`. --cronTimeZone defaults to UTC. --active defaults to true.
run id
Trigger one schedule immediately. The stored cron expression is unchanged.
update id
Change cron, description, ref, time zone, or variables. Only the flags you pass are updated. --create-variable, --update-variable, and --delete-variable edit variables.
delete id
Delete a schedule. Pipelines it already created stay.

INSTALL

sudo apt install glab
copy
sudo dnf install glab
copy
sudo pacman -S glab
copy
sudo apk add glab
copy
sudo zypper install glab
copy
brew install glab
copy
nix profile install nixpkgs#glab
copy

CAVEATS

Create and update talk to the GitLab API for the authenticated account. glab auth must already have a token that can edit CI schedules on that project. Variable values are sent to GitLab as part of the schedule.

SEE ALSO

RESOURCES

Copied to clipboard
Kai