ci: Begin Jenkins pipeline

This commit is contained in:
2025-11-16 05:45:52 -06:00
parent 80088e46c8
commit cdc38a9f5a
4 changed files with 105 additions and 0 deletions

52
ci/Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,52 @@
pipeline {
agent none
stages {
stage('RPM') {
matrix {
axes {
axis {
name 'FEDORA'
values '41', '42'
}
}
agent {
kubernetes {
yamlFile 'ci/podTemplate.yaml'
yamlMergeStrategy merge()
defaultContainer 'fedora'
containerTemplate {
name 'fedora'
image "registry.fedoraproject.org/fedora:${FEDORA}"
}
}
}
stages {
stage('Prepare') {
steps {
sh '. ci/prepare.sh'
}
}
stage('Build') {
steps {
sh '. ci/build.sh'
}
}
}
}
}
}
post {
failure {
emailext(
to: 'gyrfalcon@ebonfire.com',
subject: '$DEFAULT_SUBJECT',
body: '$DEFAULT_CONTENT',
)
}
}
}

21
ci/build.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/sh
if [ $(id -u) -eq 0 ]; then
exec setpriv --clear-groups --reuid 1000 --regid 1000 --inh-caps=-all \
sh -ex ci/build.sh
fi
git_rev=$(
sed -nr '/^%global git_revision_full/s/.* ([a-z0-9]{40})$/\1/p' \
gasket-driver.spec
)
curl -fL \
-o gasket-driver-${git_rev}.tar.gz \
https://github.com/google/gasket-driver/archive/${git_rev}.tar.gz
rpmbuild \
-D "_topdir ${PWD}" \
-D '_sourcedir %{_topdir}' \
-ba gasket-driver.spec
ln RPMS/*/*.rpm SRPMS/*.rpm .

24
ci/podTemplate.yaml Normal file
View File

@@ -0,0 +1,24 @@
spec:
containers:
- name: fedora
command:
- cat
stdin: true
tty: true
resources:
requests:
cpu: 1500m
securityContext:
runAsUser: 0
runAsGroup: 0
volumeMounts:
- mountPath: /etc/ssh/ssh_known_hosts
name: ssh-known-hosts
subPath: ssh_known_hosts
hostUsers: false
nodeSelector:
du5t1n.me/jenkins:
volumes:
- name: ssh-known-hosts
configMap:
name: ssh-known-hosts

8
ci/prepare.sh Normal file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
xargs dnf install -y --setopt install_weak_deps=0 <<EOF
kernel-devel
rpm-build
rpm-sign
util-linux
EOF