OSDN Git Service

gitlab: don't run CI jobs in forks by default
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 27 May 2022 15:36:02 +0000 (16:36 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Wed, 1 Jun 2022 17:54:59 +0000 (18:54 +0100)
commit28357dc525b4798cdef1101cbb459afcd7233280
tree434e96d6e15290eba3cd76e69da3be471fef452a
parente312d1fdbbb3a53ee30ab84203344588154129f9
gitlab: don't run CI jobs in forks by default

To preserve CI shared runner credits we don't want to run
pipelines on every push.

This sets up the config so that pipelines are never created
for contributors by default. To override this the QEMU_CI
variable can be set to a non-zero value. If set to 1, the
pipeline will be created but all jobs will remain manually
started. The contributor can selectively run jobs that they
care about. If set to 2, the pipeline will be created and
all jobs will immediately start.

This behavior can be controlled using push variables

  git push -o ci.variable=QEMU_CI=1

To make this more convenient define an alias

   git config --local alias.push-ci "push -o ci.variable=QEMU_CI=1"
   git config --local alias.push-ci-now "push -o ci.variable=QEMU_CI=2"

Which lets you run

  git push-ci

to create the pipeline, or

  git push-ci-now

to create and run the pipeline

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20220526110705.59952-6-berrange@redhat.com>
[AJB: fix typo, replicate alias tips in ci.rst]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220527153603.887929-33-alex.bennee@linaro.org>
.gitlab-ci.d/base.yml
docs/devel/ci-jobs.rst.inc