aboutsummaryrefslogtreecommitdiffstats
path: root/jobs/gerrit-lint.yml
blob: 602ce68bf4744d6b70cbb659ce079e4c107fee9e (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# This file holds all gerrit lint verifications https://jenkins.osmocom.org/jenkins/view/Jenkins-Gerrit/.
# One can simply add a gerrit job by adding project's repository to repos list.

- project:
    name: gerrit-lint
    # following default values can be overridden by each repo
    disabled: false
    gerrit_url: 'ssh://jenkins@gerrit.osmocom.org:29418'
    repos_url: '{gerrit_url}/{repos}'
    gerrit_project: '{repos}'

    # in alphabetical order
    repos:
      - asn1c
      - cellmgr-ng
      - docker-playground
      - libasn1c
      - libgtpnl
      - libosmo-abis
      - libosmo-gprs
      - libosmo-netif
      - libosmo-pfcp
      - libosmo-sccp
      - libosmocore
      - libsmpp34
      - libtelnet
      - libusrp
      - openbsc
      - openggsn
      - osmo-bsc
      - osmo-bsc-nat
      - osmo-bts
      - osmo-hnodeb
      - osmo-hnbgw
      - osmo-upf
      - osmo-ci

      - osmo_dia2gsup:
          repos_url: '{gerrit_url}/erlang/{repos}'
          gerrit_project: 'erlang/{repos}'

      - osmo-e1-hardware
      - osmo-ggsn
      - osmo-gsm-manuals

      - osmo_gsup:
          repos_url: '{gerrit_url}/erlang/{repos}'
          gerrit_project: 'erlang/{repos}'

      - osmo-hlr
      - osmo-iuh
      - osmo-mgw
      - osmo-msc
      - osmo-pcap
      - osmo-pcu

      - osmo-python-tests:
          repos_url: '{gerrit_url}/python/{repos}'
          gerrit_project: 'python/{repos}'

      - osmo-sgsn

      - osmo_ss7:
          repos_url: '{gerrit_url}/erlang/{repos}'
          gerrit_project: 'erlang/{repos}'

      - osmo-sip-connector
      - osmo-trx
      - osmocom-bb
      - osmo-tetra
      - osmo-sysmon
      - osmo-remsim
      - simtrace2
      - osmo-asf4-dfu
      - osmo-ccid-firmware
      - osmo-e1d
      - osmo-cbc
      - osmo-e1-recorder
      - gapk
      - osmo-uecups
      - osmo-el2tpd
      - osmo-smlc
      - osmo-gbproxy
      - pysim

      - osmo-ttcn3-hacks:
          repos_url: 'https://gerrit.osmocom.org/{repos}'

    jobs:
      - 'gerrit-{repos}-lint'

- job-template:
    name: 'gerrit-{repos}-lint'
    project-type: freestyle
    node: osmocom-gerrit-debian9
    disabled: '{obj:disabled}'
    retry-count: 3 # scm checkout
    properties:
      - build-discarder:
          days-to-keep: 30
          num-to-keep: 120
          artifact-days-to-keep: -1
          artifact-num-to-keep: -1
    description: |
      Run linting on patches submitted to gerrit for
      <a href="https://gerrit.osmocom.org/#/q/status:open+project:{repos}">{repos}</a>
      </br></br>
      Related issue: <a href="https://osmocom.org/issues/5087">OS#5087</a>

    parameters:
      - string:
          name: BRANCH_CI
          description: |
                osmo-ci.git branch
          default: 'master'

    scm:
      - git:
         basedir: 'code-from-gerrit'
         url: '{obj:repos_url}'
         credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d
         branches:
           - $GERRIT_BRANCH
         refspec: $GERRIT_REFSPEC
         name:
         choosing-strategy: gerrit
         wipe-workspace: false
         skip-tag: true
         submodule:
           recursive: false
      - git:
         basedir: 'osmo-ci'
         url: '{gerrit_url}/osmo-ci'
         credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d
         branches:
           - '$BRANCH_CI'
         wipe-workspace: true

    triggers:
      - gerrit:
          trigger-on:
            - patchset-created-event:
                exclude-drafts: true
                exclude-no-code-change: true
          projects:
            - project-compare-type: 'PLAIN'
              project-pattern: '{obj:gerrit_project}'
              branches:
                - branch-compare-type: 'ANT'
                  branch-pattern: '**'
          skip-vote:
              successful: false
              failed: false
              unstable: false
              notbuilt: false
          silent: false
          escape-quotes: false
          no-name-and-email: false
          trigger-for-unreviewed-patches: true
          server-name: gerrit.osmocom.org

    builders:
      - shell: 'cd code-from-gerrit && ../osmo-ci/lint/lint_diff.sh HEAD~1'

    wrappers:
    - ansicolor:
        colormap: xterm
    - ssh-agent-credentials:
        users:
        - d5eda5e9-b59d-44ba-88d2-43473cb6e42d

# vim: expandtab tabstop=2 shiftwidth=2