-
Notifications
You must be signed in to change notification settings - Fork 2
/
job-template.yaml.inc
167 lines (164 loc) · 5.75 KB
/
job-template.yaml.inc
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
166
167
# Hey, emacs, this is -*- yaml -*-
- job-template:
name: '{name}_{package}-source'
project-type: matrix
execution-strategy:
sequential: '{obj:sequential}'
scm:
- git:
url: '{git-url}'
name: origin
refspec: +refs/heads/*:refs/remotes/origin/*
basedir: source
branches: '{obj:branches}'
wipe-workspace: false
axes:
- axis:
type: user-defined
name: distribution
values: '{obj:distributions}'
builders:
- shell: |
rm -f ./* || true
- shell: |
export distribution=debian$(distro-info -r --series=${{distribution}})
export TIMESTAMP_FORMAT="%Y%m%d"
export PRE_DCH_HOOK="/var/lib/jenkins/bin/maybe-gen-control"
/usr/bin/generate-git-snapshot
# - shell: |
# mkdir -p report
# /usr/bin/lintian-junit-report *.dsc > report/lintian.xml
publishers:
- archive:
artifacts: '*.gz,*.gz.asc,*.bz2,*.bz2.asc,*.xz,*.xz.asc,*.deb,*.dsc,*.git,*.changes,lintian.txt'
- trigger:
project: '{name}_{package}-binaries'
# - junit:
# results: '**/lintian.xml'
# keep-long-stdio: false
- fingerprint:
record-artifacts: true
properties:
- build-discarder:
num-to-keep: 1
artifact-num-to-keep: 1
- job-template:
name: '{name}_{package}-binaries'
project-type: matrix
description: |
<p>Build Debian binary packages of {package}.<br />Do not edit this job through the web, it is generated via jenkins-job-builder!</p>
<p>Usage instructions how to remotely access and use the repository can be found in the <a href="https://packages.sury.org/{repo}/">{repo} repository</a></p>
<p>Or if you really hate security or you just do not care about it:
<pre>
curl -L https://packages.sury.org/{repo}/README.txt | bash -x
</pre>
execution-strategy:
combination-filter: |
(architecture == "amd64" && node == "amd64") || (architecture == "i386" && node == "i386") || (architecture == "armhf" && node == "armhf") || (architecture == "arm64" && node == "arm64")
sequential: '{obj:sequential}'
touchstone:
expr: 'architecture == "amd64"'
result: 'stable'
axes:
- axis:
type: user-defined
name: architecture
values: '{obj:architectures}'
- axis:
type: user-defined
name: distribution
values: '{obj:distributions}'
- axis:
type: slave
name: node
values:
- amd64
- i386
- armhf
- arm64
builders:
- copyartifact:
project: '{name}_{package}-source/distribution=${{distribution}}'
filter: '*'
which-build: upstream-build
fallback-to-last-successful: true
- shell: |
export POST_BUILD_HOOK=/usr/bin/jdg-debc
export release=$distribution
export EXTRAPACKAGES="apt-transport-https"
export RELEASE_REPOSITORY=/srv/repository/{repo}
export RELEASE_DISTRIBUTION=$distribution
export DEB_BUILD_OPTIONS="{deb_build_options}"
export DEB_BUILD_PROFILES="{deb_build_profiles}"
if [ "$release" != "sid" ]; then export REPOSITORY_EXTRA="{repository_extra}"; fi
export REPOSITORY_EXTRA_KEYS="{repository_extra_keys}"
/usr/bin/build-and-provide-package
- shell: |
/var/lib/jenkins/bin/sync-repository "{repo}"
- shell: |
export REPOSITORY=/srv/repository/{repo}
echo "Listing packages inside the {repo} repository:"
/usr/bin/repository_checker --list-repos $distribution
# - shell: |
# mkdir -p report
# /usr/bin/lintian-junit-report *.dsc > report/lintian.xml
publishers:
- archive:
artifacts: '*.gz,*.gz.asc,*.bz2,*.bz2.asc,*.xz,*.xz.asc,*.deb,*.dsc,*.git,*.changes,lintian.txt'
# - junit:
# results: '**/lintian.xml'
# keep-long-stdio: false
- fingerprint:
record-artifacts: true
# - trigger:
# project: '{name}_{package}-piuparts'
- workspace-cleanup:
dirmatch: false
wrappers:
- timestamps
properties:
- build-discarder:
num-to-keep: 1
artifact-num-to-keep: 1
- job-template:
name: '{name}_{package}-piuparts'
project-type: freestyle
description: 'Installation and upgrade tests for {package} Debian packages.<br />Do not edit this job through the web, it is generated via jenkins-job-builder!'
disabled: false
parameters:
- string:
name: architecture
default: '{architectures[0]}'
description: "Architecture that should be used."
- string:
name: distribution
default: '{distributions[0]}'
description: "Distribution that should be used."
builders:
- copyartifact:
project: '{name}_{package}-binaries/architecture=${{architecture}},distribution=${{distribution}}'
filter: '*.deb'
which-build: upstream-build
fallback-to-last-successful: true
flatten: true
target: 'artifacts/'
- shell: |
# sadly piuparts always returns with exit code 1 :((
sudo piuparts_wrapper ${{PWD}}/artifacts/*.deb || true
- shell: |
piuparts_tap piuparts.txt > piuparts.tap
publishers:
- tap:
results: 'piuparts.tap'
- archive:
artifacts: 'piuparts.*'
- fingerprint:
record-artifacts: true
- workspace-cleanup:
dirmatch: false
wrappers:
- timestamps
properties:
- build-discarder:
num-to-keep: 1
artifact-num-to-keep: 1