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.
25 lines
407 B
Bash
25 lines
407 B
Bash
#!/bin/sh
|
|
|
|
REPO_HOST=jenkins@files.pyrocufflink.blue
|
|
REPO_PATH=/srv/www/repohost/repos/dch/fedora/$(rpm --eval %fedora)
|
|
|
|
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 \
|
|
--chmod=ugo=rwX \
|
|
--include "${include}" \
|
|
--exclude '*' \
|
|
cli/ \
|
|
"${REPO_HOST}:${REPO_PATH}/"
|