aboutsummaryrefslogtreecommitdiff
path: root/tcwg-publish-snapshot.yaml
blob: aefaa3cca92d007d115c29765c2f417ea8759974 (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
- job:
    name: tcwg-publish-snapshot
    project-type: freestyle
    defaults: global
    logrotate:
        daysToKeep: 30
        numToKeep: 30
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            linaro:
                - job-build
                - job-cancel
    parameters:
        - string:
                name: snapshot_version
                default: ''
                description: 'Snapshot revision to deploy (like: 5.2-2015.10)'
        - string:
                name: notes_branch
                default: 'refs/heads/toolchain-snapshots'
                description: 'Release notes branch name or sha1'
        - bool:
               name: notes_only
               default: false
               description: 'Publish release notes only'
    disabled: false
    node: tcwg-x86_64-ex40build-01
    display-name: 'TCWG - Snapshot source tarball publishing'
    wrappers:
        - timestamps
    builders:
        - linaro-publish-token
        - shell: |
            #!/bin/bash

            set -ex

            trap cleanup_exit INT TERM EXIT

            cleanup_exit()
            {
              cd ${WORKSPACE}
              rm -rf out
            }

            # Extract GCC version
            # Since GCC 5 our branch name only contains GCC major number.
            gcc_version=${snapshot_version%%-*}
            gcc_major=${gcc_version%%.*}
            [ $gcc_major -ge "5" ] && gcc_version=$gcc_major

            # Release notes
            notes_url=https://git.linaro.org/toolchain/release-notes.git/blob_plain/${notes_branch}

            mkdir -p out
            wget $notes_url:/components/toolchain/gcc-linaro/${gcc_version}/README.textile -O out/README.textile
            if ! ${notes_only}; then
              cp /work/space/sources/gcc-linaro-snapshot-${snapshot_version}.tar.* out/
            fi

            # Publish to snapshots
            test -d ${HOME}/bin || mkdir ${HOME}/bin
            wget https://git.linaro.org/ci/publishing-api.git/blob_plain/HEAD:/linaro-cp.py -O ${HOME}/bin/linaro-cp.py
            time python ${HOME}/bin/linaro-cp.py \
              out components/toolchain/gcc-linaro/${snapshot_version}/
    publishers:
        - email-ext:
            recipients: 'bernhard.rosenkranzer@linaro.org, fathi.boudra@linaro.org, koen.kooi@linaro.org'
            always: true