blob: ba15f8c12e9f02a74cf45bf34f8fe727d2b956fb (
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
|
- job:
name: build-ofp-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 debian source for openfastpath.org'
scm:
- git:
url: https://github.com/OpenFastPath/ofp.git
refspec: +refs/heads/master:refs/remotes/origin/master
name: origin
branches:
- refs/heads/master
basedir: ofp
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=ofp
cd ${pkg_source}
base_version=$(git describe --long --match='v*' | sed -e 's/^v//' | cut -d'-' -f1)
nb_commit=$(git describe --long --match='v*' | sed -e 's/^v//' | cut -d'-' -f2)
scm_commit=$(git log -n1 --pretty=format:%h)
pkg_version=${base_version}+git${nb_commit}+${scm_commit}
pkg_dir=${pkg_source}-${pkg_version}
git config tar.tar.xz.command "xz -c"
git archive --format=tar.xz --prefix=${pkg_dir}/ origin/master > ../${pkg_source}_${pkg_version}.orig.tar.xz
cd ..
tar xf ${pkg_source}_${pkg_version}.orig.tar.xz
packaging_dir=ofp-packaging
packaging_repository=https://git.linaro.org/people/anders.roxell/${packaging_dir}.git
git clone -b master --depth 1 ${packaging_repository}
packaging_commit=$(cd ${packaging_dir} && git log -n1 --pretty=format:%h)
mv ${packaging_dir}/pkg/debian ${pkg_dir}
rm -rf ${pkg_source} ${packaging_dir}
cd ${pkg_dir}
pkg_repository=https://github.com/OpenFastPath/ofp.git
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'
|