aboutsummaryrefslogtreecommitdiff
path: root/build-dpdk-deb.yaml
blob: 75a02b47a095aa6baad84c8f2b0eaa814e98e623 (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
- job:
    name: build-dpdk-deb
    project-type: freestyle
    defaults: global
    properties:
        - build-discarder:
            num-to-keep: 30
            days-to-keep: 30
            artifact-num-to-keep: 1
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            linaro:
                - job-read
                - job-extended-read
                - job-build
                - job-cancel
    disabled: false
    node: docker-jessie-arm64
    display-name: 'Build DPDK deb packages for opendataplane.org'
    scm:
        - git:
            url: http://dpdk.org/git/dpdk
            refspec: +refs/heads/master:refs/remotes/origin/master
            name: origin
            branches:
                - refs/heads/master
            basedir: dpdk
            skip-tag: true
            shallow-clone: false
            wipe-workspace: false
    wrappers:
        - timestamps
        - build-name:
            name: '#${BUILD_NUMBER}-${GIT_REVISION,length=8}'
        - timeout:
            timeout: 20
    builders:
        - shell: |
            #!/bin/bash

            set -ex

            wget -qO - http://deb.opendataplane.org/odp.key | sudo apt-key add -
            echo 'deb http://deb.opendataplane.org/ jessie main' | sudo tee /etc/apt/sources.list.d/odp.list

            sudo apt-get -q=2 update
            sudo apt-get -q=2 -y --no-install-recommends install debhelper devscripts xz-utils

            pkg_source=dpdk
            cd ${pkg_source}

            git checkout v16.07

            base_version=$(git describe --match='v*' | sed -e 's/^v//' | cut -d'-' -f1)
            nb_commit=$(git describe --match='v*' | sed -e 's/^v//' | cut -d'-' -f2)
            scm_commit=$(git log -n1 --pretty=format:%h)
            # For snapshot version
            # pkg_version=${base_version}+git${nb_commit}+${scm_commit}
            # For tagged version
            pkg_version=${base_version}
            pkg_dir=${pkg_source}-${pkg_version}

            git config tar.tar.xz.command "xz -c"
            git archive --format=tar.xz --prefix=${pkg_dir}/ v16.07 > ../${pkg_source}_${pkg_version}.orig.tar.xz

            cd ..

            tar xf ${pkg_source}_${pkg_version}.orig.tar.xz

            packaging_dir=deb_dpdk
            packaging_repository=https://gerrit.fd.io/r/p/${packaging_dir}.git
            git clone -b deb_dpdk_16.07 --depth 1 ${packaging_repository}
            packaging_commit=$(cd ${packaging_dir} && git log -n1 --pretty=format:%h)
            mv ${packaging_dir}/debian ${pkg_dir}

            rm -rf ${pkg_source} ${packaging_dir}

            cd ${pkg_dir}

            pkg_repository=http://dpdk.org/git/dpdk
            current_date=$(date -R)

            cat > debian/changelog << EOF
            ${pkg_source} (${pkg_version}-0linaro1) unstable; urgency=medium

              * CI - ${pkg_source} snapshot:
                - repository: ${pkg_repository}
                - commit: ${scm_commit}
                - build: ${BUILD_URL}

                - debian/ repository: ${packaging_repository}
                - debian/ commit: ${packaging_commit}

             -- Anders Roxell <anders.roxell@linaro.org>  ${current_date}

            EOF

            dpkg-buildpackage -d -nc -us -uc -rfakeroot -S -sa

            cd ..

            cat > ${WORKSPACE}/build-package.properties <<EOF
            codename=jessie
            source=${BUILD_URL}/artifact/${pkg_source}_${pkg_version}-0linaro1.dsc
            repo=odp-staging
            EOF
    publishers:
        - archive:
            artifacts: '*.dsc, *.gz, *.xz'
        - trigger-parameterized-builds:
            - project: build-package
              property-file: build-package.properties
              condition: SUCCESS
        - email:
            recipients: 'anders.roxell@linaro.org fathi.boudra@linaro.org'