aboutsummaryrefslogtreecommitdiff
path: root/tcwg-make-gcc-release-tag.yaml
blob: f9752b0ea03fd9ea0f3c0d87dac6b85647105194 (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
- job:
    name: tcwg-make-gcc-release-tag
    project-type: freestyle
    defaults: global
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            linaro:
                - job-build
                - job-cancel
        - build-discarder:
            days-to-keep: 10
            num-to-keep: 10
    parameters:
        - choice:
            name: tag_kind
            choices:
                - snapshot
                - candidate
                - release
            description: 'Type of release to do.'
        - string:
            name: spin
            default: ''
            description: 'Spin number'
        - string:
            name: gcc_ref
            default: ''
            description: 'GCC tag or branch name (like linaro-6.3-2017.03, linaro/gcc-6-branch)'
        - string:
            name: date
            default: ''
            description: 'Snapshot or Release date (YYYY.MM)'
    disabled: false
    node: tcwg-x86_64-dev-01-short
    retry-count: 3
    concurrent: true
    display-name: 'TCWG Tag GCC Sources'
    scm:
        - git:
            url: https://git-us.linaro.org/toolchain/gcc.git
            refspec: +refs/heads/*:refs/remotes/origin/*
            branches:
                - refs/heads/master
            basedir: gcc_src
            scm-name: GCC
            per-build-tag: false
            wipe-workspace: false
            reference-repo: /home/tcwg-buildslave/snapshots-ref/gcc.git
            clean:
                before: true
    execution-strategy:
        sequential: true
    wrappers:
        - timeout:
            timeout: 300
        - timestamps
        - ssh-agent-credentials:
            # tcwg-buildslave user id
            users:
                - 'e0958a95-204f-4c14-a66c-5e2be6c5d50a'
        - build-name:
            name: '#${BUILD_NUMBER}-${gcc_ref}'
    builders:
        - shell: |
            #!/bin/bash
            set -ex

            rm -rf release
            rm -rf tcwg-release-tools
            git clone -b automation --depth 1 https://git-us.linaro.org/toolchain/tcwg-release-tools

            pushd gcc_src

            git config --local user.name "TCWG Automation"
            git config --local user.email linaro-toolchain@lists.linaro.org
            if git remote | grep -q gerrit; then
              git remote rm gerrit
            fi
            git remote add gerrit ssh://tcwg-buildslave@review.linaro.org:29418/toolchain/gcc

            FLAGS="-t $gcc_ref -e gerrit"
            
            case "$tag_kind" in
                snapshot) FLAGS="$FLAGS -R" ;;
                candidate) FLAGS="$FLAGS -r" ;;
                release) FLAGS="$FLAGS -R";;
                *) echo "ERROR: tag_king is missing"; exit 1 ;;
            esac

            if [ x"$spin" != x ]; then
                FLAGS="$FLAGS $spin"
            fi

            if [ x"$date" != x ]; then
                FLAGS="$FLAGS -d $date"
            fi

            ${WORKSPACE}/tcwg-release-tools/tcwg-release-tag.sh $FLAGS

            popd 1>/dev/null