-
Notifications
You must be signed in to change notification settings - Fork 50
/
Jenkinsfile
107 lines (101 loc) · 5.02 KB
/
Jenkinsfile
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
#!groovy
// List of packages to build. Note that this list is overridden in the packaging
// repository, where additional variants may be added for enterprise.
//
// This list is ordered by Distro (alphabetically), and release (chronologically).
// When adding a distro here, also open a pull request in the release repository.
def images = [
[image: "docker.io/library/amazonlinux:2", arches: ["aarch64"]],
[image: "quay.io/centos/centos:stream9", arches: ["amd64", "aarch64"]], // CentOS Stream 9 (EOL: 2027)
[image: "quay.io/centos/centos:stream10", arches: ["amd64", "aarch64"]], // CentOS Stream 10 (EOL: 2030)
[image: "docker.io/library/rockylinux:8", arches: ["amd64", "aarch64"]], // Rocky Linux 8 (EOL: 2029-05-31)
[image: "docker.io/library/rockylinux:9", arches: ["amd64", "aarch64"]], // Rocky Linux 9 (EOL: 2032-05-31)
[image: "docker.io/library/almalinux:8", arches: ["amd64", "aarch64"]], // AlmaLinux 8 (EOL: 2029)
[image: "docker.io/library/almalinux:9", arches: ["amd64", "aarch64"]], // AlmaLinux 9 (EOL: 2032)
[image: "docker.io/library/debian:bullseye", arches: ["amd64", "aarch64", "armhf"]], // Debian 11 (EOL: 2024)
[image: "docker.io/library/debian:bookworm", arches: ["amd64", "aarch64", "armhf"]], // Debian 12 (stable)
[image: "docker.io/library/debian:trixie", arches: ["amd64", "aarch64", "armhf"]], // Debian 13 (testing)
[image: "docker.io/library/fedora:40", arches: ["amd64", "aarch64"]], // Fedora 40 (EOL: May 13, 2025)
[image: "docker.io/library/fedora:41", arches: ["amd64", "aarch64"]], // Fedora 41 (EOL: November, 2025)
[image: "docker.io/library/fedora:rawhide", arches: ["amd64", "aarch64"]], // Rawhide is the name given to the current development version of Fedora
[image: "docker.io/opensuse/leap:15", arches: ["amd64"]],
[image: "docker.io/balenalib/rpi-raspbian:bullseye",arches: ["armhf"]],
[image: "docker.io/balenalib/rpi-raspbian:bookworm",arches: ["armhf"]],
[image: "docker.io/library/ubuntu:focal", arches: ["amd64", "aarch64", "armhf"]], // Ubuntu 20.04 LTS (End of support: April, 2025. EOL: April, 2030)
[image: "docker.io/library/ubuntu:jammy", arches: ["amd64", "aarch64", "armhf"]], // Ubuntu 22.04 LTS (End of support: April, 2027. EOL: April, 2032)
[image: "docker.io/library/ubuntu:noble", arches: ["amd64", "aarch64", "armhf"]], // Ubuntu 24.04 LTS (End of support: April, 2029. EOL: April, 2034)
[image: "docker.io/library/ubuntu:oracular", arches: ["amd64", "aarch64", "armhf"]], // Ubuntu 24.10 (EOL: July, 2025)
]
def generatePackageStep(opts, arch) {
return {
wrappedNode(label: "ubuntu-2004 && ${arch}") {
stage("${opts.image}-${arch}") {
// This is just a "dummy" stage to make the distro/arch visible
// in Jenkins' BlueOcean view, which truncates names....
sh 'echo starting...'
}
stage("info") {
sh 'docker version'
sh 'docker info'
sh '''
curl -fsSL "https://raw.githubusercontent.com/moby/moby/master/contrib/check-config.sh" | bash || true
'''
}
stage("checkout") {
checkout scm
sh 'make clean'
}
stage("build") {
sh "make CREATE_ARCHIVE=1 ARCH=${arch} ${opts.image}"
archiveArtifacts(artifacts: 'archive/*.tar.gz', onlyIfSuccessful: true)
}
stage("build-main") {
// We're not archiving these builds as they have the same name
// as the 1.7 builds, so would replace those. We're building
// the main branch to verify that the scripts work for main (2.0)
sh "make REF=main ARCH=${arch} ${opts.image}"
}
}
}
}
def generatePackageSteps(opts) {
return opts.arches.collectEntries {
["${opts.image}-${it}": generatePackageStep(opts, it)]
}
}
def packageBuildSteps = [
"windows": { ->
node("windows-2022") {
stage("windows") {
try {
checkout scm
sh("make -f Makefile.win archive")
} finally {
deleteDir()
}
}
}
}
]
packageBuildSteps << images.collectEntries { generatePackageSteps(it) }
pipeline {
agent none
stages {
stage('Check file headers') {
agent { label 'ubuntu-2004 && amd64' }
steps{
script{
checkout scm
sh "make validate"
}
}
}
stage('Build packages') {
steps {
script {
parallel(packageBuildSteps)
}
}
}
}
}