aboutsummaryrefslogtreecommitdiff
path: root/tcwg-backport.yaml
blob: 56dd2b402d43282450128764cfb83db48f0a08a9 (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
- job:
    name: tcwg-backport
    project-type: freestyle
    defaults: global
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            linaro:
                - job-build
                - job-cancel
        - build-discarder:
            days-to-keep: 30
            num-to-keep: 60
    parameters:
        - string:
            name: GERRIT_PATCHSET_REVISION
            default: refs/remotes/origin/linaro/gcc-5-branch
            description: 'Patched GCC revision'
        - string:
            name: GERRIT_BRANCH
            default: linaro-local/gcc-5-integration-branch
            description: 'Base GCC branch'
        - string:
            name: gcc_orig
            default: gcc_patch_prev
            description: 'Original GCC revision'
        - string:
            name: log_server
            default: dev-01.tcwglab:/home/tcwg-buildslave/logs
            description: 'Log_Server'
        - string:
            name: target_list
            default: 'aarch64-linux-gnu armv8l-linux-gnueabihf arm-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf aarch64-none-elf aarch64_be-none-elf tcwg-x86_64-build tcwg-x86_32-build'
            description: 'List of targets -- aarch64-linux-gnu armv8l-linux-gnueabihf arm-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf aarch64-none-elf aarch64_be-none-elf tcwg-x86_64-build tcwg-x86_32-build tcwg-tk1_32-build tcwg-apm_64-build tcwg-apm_32-build -- the tcwg-* targets should be a subset of slave axis'
        - string:
            name: abe_branch
            default: refs/remotes/origin/tested
            description: 'ABE revision to use'
        - bool:
            name: rebuild
            default: false
            description: 'Rebuild the toolchain even if results are already on logserver'
    disabled: false
    node: tcwg-x86_64-dev-01
    concurrent: true
    display-name: 'TCWG AAA Backport'
    scm:
        - git:
            url: https://git-us.linaro.org/toolchain/gcc.git
            refspec: +refs/changes/*:refs/remotes/changes/*
            basedir: gcc
            branches:
                - ${GERRIT_PATCHSET_REVISION}
            skip-tag: true
            wipe-workspace: false
            reference-repo: /home/tcwg-buildslave/snapshots-ref/gcc.git
            choosing-strategy: gerrit
        - git:
            url: https://git-us.linaro.org/toolchain/abe.git
            refspec: +refs/changes/*:refs/remotes/changes/*
            basedir: abe
            branches:
                - $abe_branch
            skip-tag: true
            shallow-clone: true
            wipe-workspace: true
    triggers:
        - gerrit:
            server-name: 'review.linaro.org'
            override-votes: true
            gerrit-build-successful-verified-value: 1
            gerrit-build-failed-verified-value: -1
            gerrit-build-successful-codereview-value: 1
            gerrit-build-failed-codereview-value: -1
            readable-message: true
            successful-message: 'Sanity check OK'
            failure-message: 'Sanity check FAIL'
            trigger-for-unreviewed-patches: true
            projects:
                - project-compare-type: 'PLAIN'
                  project-pattern: 'toolchain/gcc'
                  branches:
                    - branch-compare-type: 'ANT'
                      branch-pattern: '**'
    wrappers:
        - timeout:
            timeout: 3000
        - timestamps
        - ssh-agent-credentials:
            # tcwg-buildslave user id
            users:
                - 'e0958a95-204f-4c14-a66c-5e2be6c5d50a'
        - build-name:
            name: '#${BUILD_NUMBER}-${ENV,var="GERRIT_PATCHSET_REVISION"}'
    builders:
        - shell: |
            #!/bin/bash

            set -e
            set -x

            abe_rev=$(git -C abe rev-parse --short $abe_branch)
            gcc_patch_rev=$(git -C gcc rev-parse $GERRIT_PATCHSET_REVISION)
            if [ x"$gcc_orig" = x"gcc_patch_prev" ]; then
              gcc_orig="$gcc_patch_rev^"
            fi
            gcc_orig_rev=$(git -C gcc rev-parse $gcc_orig)

            case ${GERRIT_BRANCH} in
              *gcc-4_9*)
                toolchainconf='--extraconfigdir ../config/gcc4_9'
                ;;
              *gcc-5*)
                toolchainconf='--extraconfigdir ../config/gcc5'
                ;;
              *gcc-6*)
                toolchainconf='--extraconfigdir ../config/gcc6'
                ;;
              *gcc-7*)
                toolchainconf='--extraconfigdir ../config/gcc7'
                ;;
              *)
                toolchainconf='--extraconfigdir ../config/gcc7 binutils=binutils-gdb.git/master glibc=glibc.git~master newlib=newlib.git~master'
                ;;
            esac

            cat <<EOF > gcc_orig_parameters
            override=$toolchainconf gcc=gcc.git@$gcc_orig_rev
            log_name=tcwg-backport-$gcc_orig_rev/$abe_rev/\$builder_type.\$target
            rebuild=${rebuild}
            dont_fail=true
            log_server=$log_server
            target_list=$target_list
            abe_branch=$abe_rev
            displaytag=backport-ref-${GERRIT_CHANGE_NUMBER}
            EOF

            cat <<EOF > gcc_patch_parameters
            override=$toolchainconf gcc=gcc.git@$gcc_patch_rev
            log_name=tcwg-backport-$gcc_patch_rev/$abe_rev/\$builder_type.\$target
            rebuild=${rebuild}
            dont_fail=true
            log_server=$log_server
            target_list=$target_list
            abe_branch=$abe_rev
            displaytag=backport-patch-${GERRIT_CHANGE_NUMBER}
            EOF

            cat <<EOF > compare_results_parameters
            ref_logs=tcwg-backport-$gcc_orig_rev/$abe_rev
            new_logs=tcwg-backport-$gcc_patch_rev/$abe_rev
            log_server=$log_server
            EOF
        - trigger-builds:
            - project: tcwg-buildfarm
              parameter-factories:
                - factory: filebuild
                  file-pattern: gcc_*_parameters
              block: true
        - trigger-builds:
            - project: tcwg-compare-results
              property-file: compare_results_parameters
              block: true