Skip to content

dev/sg: add ci build command

Warren Gifford requested to merge github/fork/bobheadxi/sg-ci-trigger into main

Created by: bobheadxi

Add sg ci build, which requests a build for the currently checked out branch and commit. Requires additional scopes. Works for forks - this PR is from a fork, and did not trigger a build by default (which is the intended use case of this command). To manually request a build:

❯ sg ci build  
Requesting build for branch "sg-ci-trigger" at "7eb4a47575d1d401bc92fcb089b24635838eeb71"...
❗️ Commit "7eb4a47575d1d401bc92fcb089b24635838eeb71" not found in in local 'origin/' branches - you might be triggering a build for a fork. Make sure all code has been reviewed before continuing.
Continue? (yes/no) yes
✅ Created build: https://buildkite.com/sourcegraph/sourcegraph/builds/111033

Also uses "real" commands for sg ci subcommands which gets us nice help text.

❯ sg ci -h   
USAGE
  sg ci [preview|status|build]

Interact with Sourcegraph's continuous integration pipelines on Buildkite.

Note that Sourcegraph's CI pipelines are under our enterprise license: https://github.com/sourcegraph/sourcegraph/blob/main/LICENSE.enterprise

SUBCOMMANDS
  preview  Preview the pipeline that would be run against the currently checked out branch
  status   Get the status of the CI run associated with the currently checked out branch
  build    Manually request a build for the currently checked out commit and branch

Merge request reports

Loading