summaryrefslogtreecommitdiff
path: root/ci/gitlab.yml
blob: 7bb68b848c7367bb75197a3eeead5454d86df35b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# THIS FILE WAS AUTO-GENERATED
#
#  $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci


# Variables that can be set to control the behaviour of
# pipelines that are run
#
#  - RUN_PIPELINE - force creation of a CI pipeline when
#    pushing to a branch in a forked repository. Official
#    CI pipelines are triggered when merge requests are
#    created/updated. Setting this variable to a non-empty
#    value allows CI testing prior to opening a merge request.
#
#  - RUN_PIPELINE_UPSTREAM_ENV - same semantics as RUN_PIPELINE,
#    but uses the CI environment (containers) from the upstream project
#    rather than creating and updating a throwaway environment
#    Should not be used if the pushed branch includes CI container
#    changes.
#
#  - RUN_CONTAINER_BUILDS - CI pipelines in upstream only
#    publish containers if CI file changes are detected.
#    Setting this variable to a non-empty value will force
#    re-publishing, even when no file changes are detected.
#    Typically to use from a scheduled job once a month.
#
#  - RUN_UPSTREAM_NAMESPACE - the upstream namespace is
#    configured to default to 'libvirt'. When testing
#    changes to CI it might be useful to use a different
#    upstream. Setting this variable will override the
#    namespace considered to be upstream.
#
# These can be set as git push options
#
#  $ git push -o ci.variable=RUN_PIPELINE=1
#
# Aliases can be set for common usage
#
#  $ git config --local alias.push-ci "push -o ci.variable=RUN_PIPELINE=1"
#
# Allowing the less verbose invocation
#
#  $ git push-ci
#
# Pipeline variables can also be set in the repository
# pipeline config globally, or set against scheduled pipelines


variables:
  RUN_UPSTREAM_NAMESPACE: libvirt
  FF_SCRIPT_SECTIONS: 1


workflow:
  rules:
    # upstream+forks: Avoid duplicate pipelines on pushes, if a MR is open
    - if: '$CI_PIPELINE_SOURCE == "push" && $CI_OPEN_MERGE_REQUESTS'
      when: never

    # upstream+forks: Avoid pipelines on tag pushes
    - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG'
      when: never

    # upstream+forks: Allow pipelines in scenarios we've figured out job rules
    - if: '$CI_PIPELINE_SOURCE =~ /^(push|merge_request_event|api|web|schedule)$/'
      when: always

    # upstream+forks: Avoid all other pipelines
    - when: never


debug:
  image: docker.io/library/alpine:3
  stage: sanity_checks
  interruptible: true
  needs: []
  script:
    - printenv | sort
  rules:
    - if: '$RUN_DEBUG'
      when: always

include:
  - local: '/ci/gitlab/container-templates.yml'
  - local: '/ci/gitlab/build-templates.yml'
  - local: '/ci/gitlab/sanity-checks.yml'
  - local: '/ci/gitlab/containers.yml'
  - local: '/ci/gitlab/builds.yml'