Skip to content

Commit 2a4d829

Browse files
authored
Arch packaging (runtimeverification#901)
* Jenkinsfile, k-distribution/INSTALL.md: bring back Arch distribution * [deploy-system] Jenkinsfile: test arch deployment * [DEPLOY] Jenkinsfile: try simpler regex * Jenkinsfile: build Platform Independent K Binary after other Linux distros
1 parent bdabad9 commit 2a4d829

2 files changed

Lines changed: 120 additions & 108 deletions

File tree

Jenkinsfile

Lines changed: 113 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -53,39 +53,6 @@ pipeline {
5353
parallel {
5454
stage('Build and Package K on Linux') {
5555
stages {
56-
stage('Build Platform Independent K Binary') {
57-
when {
58-
anyOf {
59-
branch 'master'
60-
changelog '.*^\\[build-system\\] .+$'
61-
changeset 'Jenkinsfile'
62-
changeset 'Dockerfile'
63-
}
64-
}
65-
agent {
66-
dockerfile {
67-
filename 'Dockerfile.debian'
68-
additionalBuildArgs '--build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) --build-arg BASE_IMAGE=ubuntu:bionic'
69-
reuseNode true
70-
}
71-
}
72-
steps {
73-
sh '''
74-
eval `opam config env`
75-
mvn --batch-mode clean
76-
mvn --batch-mode install -DskipKTest -Dcheckstyle.skip
77-
mv k-distribution/target/k-nightly.tar.gz ./
78-
'''
79-
stash name: "binary", includes: "k-nightly.tar.gz"
80-
}
81-
post {
82-
failure {
83-
slackSend color: '#cb2431' \
84-
, channel: '#k' \
85-
, message: "Platform Independent K Binary Failed: ${env.BUILD_URL}"
86-
}
87-
}
88-
}
8956
stage('Build and Package on Ubuntu Bionic') {
9057
stages {
9158
stage('Build on Ubuntu Bionic') {
@@ -164,7 +131,8 @@ pipeline {
164131
when {
165132
anyOf {
166133
branch 'master'
167-
changelog '.*^\\[build-system\\] .+$'
134+
changelog '.*^\\[BUILD\\] .+$'
135+
changelog '.*^\\[DEPLOY\\] .+$'
168136
changeset 'Jenkinsfile'
169137
changeset 'Dockerfile'
170138
}
@@ -224,76 +192,112 @@ pipeline {
224192
}
225193
}
226194
}
227-
//stage('Build and Package on Arch Linux') {
228-
// when {
229-
// anyOf {
230-
// branch 'master'
231-
// changelog '.*^\\[build-system\\] .+$'
232-
// changeset 'Jenkinsfile'
233-
// changeset 'Dockerfile'
234-
// }
235-
// }
236-
// stages {
237-
// stage('Build on Arch Linux') {
238-
// agent {
239-
// dockerfile {
240-
// filename 'Dockerfile.arch'
241-
// additionalBuildArgs '--build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g)'
242-
// reuseNode true
243-
// }
244-
// }
245-
// stages {
246-
// stage('Build Pacman Package') {
247-
// steps {
248-
// checkout scm
249-
// sh '''
250-
// makepkg
251-
// '''
252-
// stash name: "arch", includes: "kframework-5.0.0-1-x86_64.pkg.tar.xz"
253-
// }
254-
// }
255-
// }
256-
// }
257-
// stage('Test Arch Package') {
258-
// agent {
259-
// docker {
260-
// image 'archlinux/base'
261-
// args '-u 0'
262-
// reuseNode true
263-
// }
264-
// }
265-
// options { skipDefaultCheckout() }
266-
// steps {
267-
// unstash "arch"
268-
// sh '''
269-
// pacman -Syyu --noconfirm
270-
// pacman -U --noconfirm kframework-5.0.0-1-x86_64.pkg.tar.xz
271-
// src/main/scripts/test-in-container
272-
// '''
273-
// }
274-
// post {
275-
// always {
276-
// sh 'stop-kserver || true'
277-
// archiveArtifacts 'kserver.log,k-distribution/target/kserver.log'
278-
// }
279-
// }
280-
// }
281-
// }
282-
// post {
283-
// failure {
284-
// slackSend color: '#cb2431' \
285-
// , channel: '#k' \
286-
// , message: "Arch Linux Packaging Failed: ${env.BUILD_URL}"
287-
// }
288-
// }
289-
//}
195+
stage('Build and Package on Arch Linux') {
196+
when {
197+
anyOf {
198+
branch 'master'
199+
changelog '.*^\\[BUILD\\] .+$'
200+
changelog '.*^\\[DEPLOY\\] .+$'
201+
changeset 'Jenkinsfile'
202+
changeset 'Dockerfile'
203+
}
204+
}
205+
stages {
206+
stage('Build on Arch Linux') {
207+
agent {
208+
dockerfile {
209+
filename 'Dockerfile.arch'
210+
additionalBuildArgs '--build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g)'
211+
reuseNode true
212+
}
213+
}
214+
stages {
215+
stage('Build Pacman Package') {
216+
steps {
217+
checkout scm
218+
sh '''
219+
makepkg
220+
'''
221+
stash name: "arch", includes: "kframework-5.0.0-1-x86_64.pkg.tar.xz"
222+
}
223+
}
224+
}
225+
}
226+
stage('Test Arch Package') {
227+
agent {
228+
docker {
229+
image 'archlinux/base'
230+
args '-u 0'
231+
reuseNode true
232+
}
233+
}
234+
options { skipDefaultCheckout() }
235+
steps {
236+
unstash "arch"
237+
sh '''
238+
pacman -Syyu --noconfirm
239+
pacman -U --noconfirm kframework-5.0.0-1-x86_64.pkg.tar.xz
240+
src/main/scripts/test-in-container
241+
'''
242+
}
243+
post {
244+
always {
245+
sh 'stop-kserver || true'
246+
archiveArtifacts 'kserver.log,k-distribution/target/kserver.log'
247+
}
248+
}
249+
}
250+
}
251+
post {
252+
failure {
253+
slackSend color: '#cb2431' \
254+
, channel: '#k' \
255+
, message: "Arch Linux Packaging Failed: ${env.BUILD_URL}"
256+
}
257+
}
258+
}
259+
stage('Build Platform Independent K Binary') {
260+
when {
261+
anyOf {
262+
branch 'master'
263+
changelog '.*^\\[BUILD\\] .+$'
264+
changelog '.*^\\[DEPLOY\\] .+$'
265+
changeset 'Jenkinsfile'
266+
changeset 'Dockerfile'
267+
}
268+
}
269+
agent {
270+
dockerfile {
271+
filename 'Dockerfile.debian'
272+
additionalBuildArgs '--build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) --build-arg BASE_IMAGE=ubuntu:bionic'
273+
reuseNode true
274+
}
275+
}
276+
steps {
277+
sh '''
278+
eval `opam config env`
279+
mvn --batch-mode clean
280+
mvn --batch-mode install -DskipKTest -Dcheckstyle.skip
281+
mv k-distribution/target/k-nightly.tar.gz ./
282+
'''
283+
stash name: "binary", includes: "k-nightly.tar.gz"
284+
}
285+
post {
286+
failure {
287+
slackSend color: '#cb2431' \
288+
, channel: '#k' \
289+
, message: "Platform Independent K Binary Failed: ${env.BUILD_URL}"
290+
}
291+
}
292+
}
290293
}
291294
}
292295
stage('Build and Package on Mac OS') {
293296
when {
294297
anyOf {
295298
branch 'master'
296-
changelog '.*^\\[build-system\\] .+$'
299+
changelog '.*^\\[BUILD\\] .+$'
300+
changelog '.*^\\[DEPLOY\\] .+$'
297301
changeset 'Jenkinsfile'
298302
changeset 'Dockerfile'
299303
}
@@ -385,6 +389,7 @@ pipeline {
385389
}
386390
when {
387391
branch 'master'
392+
changelog '.*^\\[DEPLOY\\] .+$'
388393
beforeAgent true
389394
}
390395
environment {
@@ -403,9 +408,9 @@ pipeline {
403408
dir("buster") {
404409
unstash "buster"
405410
}
406-
//dir("arch") {
407-
// unstash "arch"
408-
//}
411+
dir("arch") {
412+
unstash "arch"
413+
}
409414
dir("mojave") {
410415
unstash "mojave"
411416
}
@@ -418,14 +423,14 @@ pipeline {
418423
echo "K Framework Release $release_tag" > release.md
419424
echo "" >> release.md
420425
cat k-distribution/INSTALL.md >> release.md
421-
hub release create \
422-
--attach kframework-${VERSION}-src.tar.gz"#Source tar.gz" \
423-
--attach bionic/kframework_${VERSION}_amd64_bionic.deb"#Ubuntu Bionic (18.04) Package" \
424-
--attach buster/kframework_${VERSION}_amd64_buster.deb"#Debian Buster (10) Package" \
425-
--attach $LOCAL_BOTTLE_NAME"#Mac OS X Homebrew Bottle" \
426-
--attach k-nightly.tar.gz"#Platform Indepdendent K Binary" \
426+
hub release create \
427+
--attach kframework-${VERSION}-src.tar.gz"#Source tar.gz" \
428+
--attach bionic/kframework_${VERSION}_amd64_bionic.deb"#Ubuntu Bionic (18.04) Package" \
429+
--attach buster/kframework_${VERSION}_amd64_buster.deb"#Debian Buster (10) Package" \
430+
--attach arch/kframework-${VERSION}/package/kframework-git-${VERSION}-1-x86_64.pkg.tar.xz"#Arch Package" \
431+
--attach $LOCAL_BOTTLE_NAME"#Mac OS X Homebrew Bottle" \
432+
--attach k-nightly.tar.gz"#Platform Indepdendent K Binary" \
427433
--file release.md "${release_tag}"
428-
# --attach arch/kframework-${VERSION}/package/kframework-git-${VERSION}-1-x86_64.pkg.tar.xz"#Arch Package" \
429434
'''
430435
}
431436
dir("homebrew-k") {

k-distribution/INSTALL.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ We currently strive to provide packages for the following platforms:
55

66
- Ubuntu Bionic (18.04)
77
- Debian Buster
8+
- Arch Linux
89
- MacOS X Mojave
910
- Platform Independent K Binary
1011

@@ -32,6 +33,12 @@ instructions tell you how to install on each system.
3233
sudo apt install ./kframework_X.Y.Z_amd64_DISTRO.deb
3334
```
3435

36+
### Arch Linux
37+
38+
```sh
39+
pacman -U ./kframework-git-X.Y.Z-1-x86_64.pkg.tar.xz
40+
```
41+
3542
### MacOS X Mojave
3643

3744
Tap the `kframework/k` bottle then install (with build number `BN`):

0 commit comments

Comments
 (0)