ci: Build CLI RPMs for aarch64
dustin/sshca/pipeline/pr-master There was a failure building this commit
Details
dustin/sshca/pipeline/pr-master There was a failure building this commit
Details
In order to automate certificate issuance and renewal for Raspberry Pi devices, we need aarch64 builds of the `sshca` tool. Using the `matrix` feature of Jenkins pipelines lets us reuse the same stage definition for building the client on both platforms. Unfortunately, the `matrix` block has to encompass the server stage as well, as `matrix` cannot be nested below `parallel`, and we don't want to build the server and clients sequentially. This makes the code a bit less clear, as the server and client stages are now conditional based on the matrix intersection, but it is cleaner than duplicating the entire client stage.
parent
eec0bfc83c
commit
56442123d4
|
@ -3,8 +3,35 @@ pipeline {
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('SSHCA') {
|
stage('SSHCA') {
|
||||||
parallel {
|
matrix {
|
||||||
|
axes {
|
||||||
|
axis {
|
||||||
|
name 'COMPONENT'
|
||||||
|
values 'client', 'server'
|
||||||
|
}
|
||||||
|
axis {
|
||||||
|
name 'ARCH'
|
||||||
|
values 'amd64', 'arm64'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
excludes {
|
||||||
|
axis {
|
||||||
|
name 'COMPONENT'
|
||||||
|
values 'server'
|
||||||
|
}
|
||||||
|
axis {
|
||||||
|
name 'ARCH'
|
||||||
|
values 'arm64'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stage('Server') {
|
stage('Server') {
|
||||||
|
when {
|
||||||
|
expression {
|
||||||
|
env.COMPONENT == 'server'
|
||||||
|
}
|
||||||
|
}
|
||||||
agent {
|
agent {
|
||||||
kubernetes {
|
kubernetes {
|
||||||
yamlFile 'ci/serverPodTemplate.yaml'
|
yamlFile 'ci/serverPodTemplate.yaml'
|
||||||
|
@ -44,11 +71,17 @@ pipeline {
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('CLI') {
|
stage('CLI') {
|
||||||
|
when {
|
||||||
|
expression {
|
||||||
|
env.COMPONENT = 'client'
|
||||||
|
}
|
||||||
|
}
|
||||||
agent {
|
agent {
|
||||||
kubernetes {
|
kubernetes {
|
||||||
yamlFile 'ci/clientPodTemplate.yaml'
|
yamlFile 'ci/clientPodTemplate.yaml'
|
||||||
yamlMergeStrategy merge()
|
yamlMergeStrategy merge()
|
||||||
defaultContainer 'fedora'
|
defaultContainer 'fedora'
|
||||||
|
nodeSelector "kubernetes.io/arch=${ARCH}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
environment {
|
environment {
|
||||||
|
@ -101,8 +134,8 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,9 @@ spec:
|
||||||
name: ssh-known-hosts
|
name: ssh-known-hosts
|
||||||
subPath: ssh_known_hosts
|
subPath: ssh_known_hosts
|
||||||
hostUsers: false
|
hostUsers: false
|
||||||
|
tolerations:
|
||||||
|
- key: du5t1n.me/machine
|
||||||
|
value: raspberrypi
|
||||||
volumes:
|
volumes:
|
||||||
- name: ssh-known-hosts
|
- name: ssh-known-hosts
|
||||||
configMap:
|
configMap:
|
||||||
|
|
|
@ -6,9 +6,19 @@ REPO_PATH=/srv/www/repohost/repos/dch/fedora/$(rpm --eval %fedora)
|
||||||
ssh-add -l
|
ssh-add -l
|
||||||
ssh-add -L
|
ssh-add -L
|
||||||
|
|
||||||
|
case "$(uname -m)" in
|
||||||
|
x86_64)
|
||||||
|
# only include the SRPM once
|
||||||
|
include='*.rpm'
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
include="*.${ARCH}.rpm"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
rsync -rtiO \
|
rsync -rtiO \
|
||||||
--chmod=ugo=rwX \
|
--chmod=ugo=rwX \
|
||||||
--include '*.rpm' \
|
--include "${include}" \
|
||||||
--exclude '*' \
|
--exclude '*' \
|
||||||
cli/ \
|
cli/ \
|
||||||
"${REPO_HOST}:${REPO_PATH}/"
|
"${REPO_HOST}:${REPO_PATH}/"
|
||||||
|
|
Loading…
Reference in New Issue