aboutsummaryrefslogtreecommitdiff
path: root/tcwg-gnu-builds.yaml
blob: c78893f7d79b8a6d7cb95217f307658c09f4ce9a (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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
# Auto generated by ./tcwg/generate-yamlfiles.sh from tcwg-gnu-builds.yaml.in and tcwg-gnu-builds/tcwg-gnu-builds.def. Do not edit.
#BEGIN: tcwg/default.yaml.inc
# -*- mode: Yaml -*-

- property:
    name: default-properties
    properties:
      - authorization:
          anonymous:
            - job-read
            - job-extended-read
          linaro:
            - job-build
            - job-cancel
      - build-discarder:
          days-to-keep: 30
          num-to-keep: 30

- scm:
    name: jenkins-scripts
    scm:
      - git:
          url: https://git.linaro.org/toolchain/jenkins-scripts.git
          refspec: +refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*
          branches:
            - $scripts_branch
          basedir: jenkins-scripts
          skip-tag: true
          reference-repo: /home/tcwg-buildslave/snapshots-ref/jenkins-scripts.git
          wipe-workspace: false
          clean:
            before: true
          prune: true

#END:   tcwg/default.yaml.inc

- job:
    name: tcwg-gnu-builds
    project-type: multijob
    defaults: global
    properties:
      - default-properties
    parameters:
      - string:
          name: release_name
          default: test
          description: 'Name of release series'
      - string:
          name: buildnumber
          default: 0
          description: 'Build number in release series'
      - choice:
          name: version
          choices:
            - latest-rel
            - master
          description: 'Toolchain version; should match a supported ABE config'
      - bool:
          name: host_x86_64_target_aarch64
          default: true
      - bool:
          name: host_x86_64_target_armhf
          default: true
      - bool:
          name: host_aarch64_target_native
          default: true
      - bool:
          name: host_aarch64_target_armhf
          default: true
      - bool:
          name: host_armhf_target_native
          default: true
      - choice:
          name: distro
          choices:
            - lts_1
            - lts
          description: 'Ubuntu distro to use for build environment'
      - bool:
          name: publish
          default: false
          description: 'Whether to publish to snapshots.linaro.org'
      - bool:
          name: verbose
          default: true
          description: 'Whether to be verbose'
    disabled: false
    node: tcwg-coordinator
    concurrent: true
    display-name: 'TCWG AAA GNU Builds'
    wrappers:
      - build-name:
          name: '#$BUILD_NUMBER-$version-$release_name-$buildnumber'
      - timeout:
          timeout: 300
      - timestamps
      - workspace-cleanup
    builders:
      - shell: |
          #!/bin/bash
          set -euf -o pipefail
          if $verbose; then
            set -x
          fi

          if [ x"$(ls)" != x"" ]; then
            echo "ERROR: Dirty workspace"
            exit 1
          fi
          
          cat > build-params.txt <<EOF
          release_name=$release_name
          buildnumber=$buildnumber
          version=$version
          distro=$distro
          EOF
      - multijob:
          name: Build
          projects:
            - name: tcwg-dev-build
              alias: "host_x86_64_target_aarch64"
              enable-condition: "$host_x86_64_target_aarch64"
              node-label-name: "builder"
              node-label: "tcwg-build && tcwg-x86_64-build"
              property-file: build-params.txt
              predefined-parameters: "target=aarch64-linux-gnu"
            - name: tcwg-dev-build
              alias: "host_x86_64_target_armhf"
              enable-condition: "$host_x86_64_target_armhf"
              node-label-name: "builder"
              node-label: "tcwg-build && tcwg-x86_64-build"
              property-file: build-params.txt
              predefined-parameters: "target=arm-linux-gnueabihf"
            - name: tcwg-dev-build
              alias: "host_aarch64_target_aarch64"
              enable-condition: "$host_aarch64_target_native"
              node-label-name: "builder"
              node-label: "tcwg-build && tcwg-armv8_64"
              property-file: build-params.txt
              predefined-parameters: "target=native"
            - name: tcwg-dev-build
              alias: "host_aarch64_target_armhf"
              enable-condition: "$host_aarch64_target_armhf"
              node-label-name: "builder"
              node-label: "tcwg-build && tcwg-armv8_64"
              property-file: build-params.txt
              predefined-parameters: "target=arm-linux-gnueabihf"
            - name: tcwg-dev-build
              alias: "host_armhf_target_native"
              enable-condition: "$host_armhf_target_native"
              node-label-name: "builder"
              node-label: "tcwg-x15 && tcwg-armv7"
              property-file: build-params.txt
              predefined-parameters: "target=native"
      - shell: |
          #!/bin/bash
          set -euf -o pipefail
          if $verbose; then
            set -x
          fi
          
          env | grep "TCWG_DEV_BUILD"
      - conditional-step:
          condition-kind: num-comp
          lhs: $TRIGGERED_BUILD_RUN_COUNT_TCWG_DEV_BUILD
          comparator: greater-than-equal
          rhs: 1
          steps:
            - copyartifact:
                project: tcwg-dev-build
                which-build: specific-build
                # Note that $TCWG_DEV_BUILD_BUILD_NUMBER points to the last
                # build (i.e., it's the same as $TCWG_DEV_BUILD_5_BUILD_NUMBER
                # in a full 5-configuration build).  At the same time,
                # $TCWG_DEV_BUILD_nnn_BUILD_NUMBER variables are defined only
                # when multiple builds were triggered.
                # We need to use $TCWG_DEV_BUILD_BUILD_NUMBER here to correctly
                # handle single-toolchain builds.
                build-number: $TCWG_DEV_BUILD_BUILD_NUMBER
                target: tcwg-dev-build-1
      - conditional-step:
          condition-kind: num-comp
          lhs: $TRIGGERED_BUILD_RUN_COUNT_TCWG_DEV_BUILD
          comparator: greater-than-equal
          rhs: 2
          steps:
            - copyartifact:
                project: tcwg-dev-build
                which-build: specific-build
                build-number: $TCWG_DEV_BUILD_1_BUILD_NUMBER
                target: tcwg-dev-build-2
      - conditional-step:
          condition-kind: num-comp
          lhs: $TRIGGERED_BUILD_RUN_COUNT_TCWG_DEV_BUILD
          comparator: greater-than-equal
          rhs: 3
          steps:
            - copyartifact:
                project: tcwg-dev-build
                which-build: specific-build
                build-number: $TCWG_DEV_BUILD_2_BUILD_NUMBER
                target: tcwg-dev-build-3
      - conditional-step:
          condition-kind: num-comp
          lhs: $TRIGGERED_BUILD_RUN_COUNT_TCWG_DEV_BUILD
          comparator: greater-than-equal
          rhs: 4
          steps:
            - copyartifact:
                project: tcwg-dev-build
                which-build: specific-build
                build-number: $TCWG_DEV_BUILD_3_BUILD_NUMBER
                target: tcwg-dev-build-4
      - conditional-step:
          condition-kind: num-comp
          lhs: $TRIGGERED_BUILD_RUN_COUNT_TCWG_DEV_BUILD
          comparator: greater-than-equal
          rhs: 5
          steps:
            - copyartifact:
                project: tcwg-dev-build
                which-build: specific-build
                build-number: $TCWG_DEV_BUILD_4_BUILD_NUMBER
                target: tcwg-dev-build-5
      - linaro-publish-token
      - shell: |
          #!/bin/bash
          set -euf -o pipefail
          if $verbose; then
            set -x
          fi

          mkdir out

          i="$TRIGGERED_BUILD_RUN_COUNT_TCWG_DEV_BUILD"
          while [ $i -gt 0 ]; do
            rsync -a tcwg-dev-build-$i/artifacts/binaries/ out/
            i=$(($i-1))
          done

          if [ x"$(ls out/ | wc -l)" != x"1" ]; then
            echo "ERROR: not a single directory in builds artifacts:"
            ls -l out/
            exit 1
          fi
          out_release=$(set +f; echo out/*-$release_name-$buildnumber)
          if ! [ -d "$out_release" ]; then
            echo "ERROR: no $out_release directory in builds artifacts:"
            ls -l out/
            exit 1
          fi

          cat > HEADER-latest-rel.textile <<EOF
          h4. Linaro Toolchain Upstream Integration Builds - Stable $release_name-$buildnumber
          
          These builds are made from latest release branches of GNU toolchain
           components.
           See included manifests for details.

          These builds are not for production environments.
           We will do our best to investigate problems reported via
           "Linaro Bugzilla":https://bugs.linaro.org/ and issue trackers of
           upstream projects.
          EOF

          cat > HEADER-master.textile <<EOF
          h4. Linaro Toolchain Upstream Integration Builds - *UNSTABLE* $release_name-$buildnumber
          
          These builds are made from whatever happened to be in master branches
           of GNU toolchain components at the moment.
           See included manifests for details.

          These builds are for experimental environments only.  They *will*
           break your stuff and drink all your beer.  You have been warned.
           We will do our best to investigate problems reported via
           "Linaro Bugzilla":https://bugs.linaro.org/ and issue trackers of
           upstream projects.
          EOF

          cp HEADER-$version.textile HEADER.textile
          cp HEADER.textile "$out_release/"

          wget https://git.linaro.org/ci/publishing-api.git/plain/linaro-cp.py -O ./linaro-cp.py
          linaro_cp_opts=""
          if ! $publish; then
            linaro_cp_opts="--dry-run"
          fi
          time python3 ./linaro-cp.py --api_version 3 $linaro_cp_opts \
            "$out_release/" "gnu-toolchain/$(basename "$out_release")"

- job:
    name: tcwg-gnu-builds-monthly
    project-type: freestyle
    defaults: global
    properties:
      - default-properties
    disabled: false
    node: tcwg-coordinator
    concurrent: false
    display-name: 'TCWG AAA GNU Builds Monthly Trigger'
    triggers:
      - timed: '@weekly'
    wrappers:
      - timeout:
          timeout: 300
      - timestamps
    builders:
      - shell: |
          #!/bin/bash
          set -euf -o pipefail
          set -x

          # Release name is Year.Month-Week_of_month
          buildnumber=$((($(date +%e)+6)/7))
          publish=false
          if [ x"$buildnumber" = x"1" ]; then
            publish=true
          fi
          cat > build-params.txt <<EOF
          release_name=$(date +%Y.%m)
          buildnumber=$buildnumber
          publish=$publish
          EOF
      - trigger-builds:
          - project: tcwg-gnu-builds
            property-file: build-params.txt
            predefined-parameters: |
              version=latest-rel
              distro=lts_1
          - project: tcwg-gnu-builds
            property-file: build-params.txt
            predefined-parameters: |
              version=master
              distro=lts
# checksum: 6eadaacf14a0b8ffd682d66a01b93b79