aboutsummaryrefslogtreecommitdiffci
path: root/Jenkinsfile
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'Jenkinsfile')
-rw-r--r--Jenkinsfile52
1 files changed, 33 insertions, 19 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index 63e7c34..1ab3e47 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -118,22 +118,31 @@ spec:
rpmdev-setuptree
- # The published file name is whatever the spec
+ # The published file names are whatever the spec
# resolves to under the tag's versions, so the two
- # cannot drift. A kernel build is expensive; if this
- # exact NEVRA is already in the bucket, skip
- # straight to the metadata.
- rpm_file=$(rpmspec -q \\
+ # cannot drift. Note the plural: kernel-surface-dtb
+ # is a separate package because the main one is
+ # installonly and cannot own a path that carries no
+ # kernel version. Publishing only the first would
+ # leave the kernel unresolvable.
+ prefix="s3://${RPM_BUCKET}/fedora/${fedora_version}/aarch64"
+ rpm_files=$(rpmspec -q \\
--define "upstream_ver ${UPSTREAM_VER}" \\
--define "patchset_ver ${PATCHSET_VER}" \\
--queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm\\n' \\
- kernel-surface.spec | head -n1)
- dest="s3://${RPM_BUCKET}/fedora/${fedora_version}/aarch64/${rpm_file}"
+ kernel-surface.spec)
- skip_build=false
- if aws s3 ls --endpoint-url "${B2_ENDPOINT}" "${dest}"; then
- echo "${rpm_file} already published, skipping build"
- skip_build=true
+ # A kernel build is expensive; skip it only when
+ # every one of those is already in the bucket.
+ skip_build=true
+ for rpm_name in ${rpm_files}; do
+ if ! aws s3 ls --endpoint-url "${B2_ENDPOINT}" \\
+ "${prefix}/${rpm_name}"; then
+ skip_build=false
+ fi
+ done
+ if [ "${skip_build}" = true ]; then
+ echo "${TAG_NAME} is already published in full, skipping build"
fi
if [ "${skip_build}" = false ]; then
@@ -146,29 +155,34 @@ spec:
--define '_smp_mflags -j4' \\
kernel-surface.spec
- built="${HOME}/rpmbuild/RPMS/aarch64/${rpm_file}"
- test -f "${built}"
+ # kernel-surface-dtb is noarch, so it lands
+ # in RPMS/noarch rather than RPMS/aarch64; ask
+ # where each one actually is.
+ for rpm_name in ${rpm_files}; do
+ built=$(find "${HOME}/rpmbuild/RPMS" -type f \\
+ -name "${rpm_name}" -print -quit)
+ test -n "${built}"
- aws s3 cp --endpoint-url "${B2_ENDPOINT}" \\
- "${built}" "${dest}"
+ aws s3 cp --endpoint-url "${B2_ENDPOINT}" \\
+ "${built}" "${prefix}/${rpm_name}"
+ done
fi
- repo_url="s3://${RPM_BUCKET}/fedora/${fedora_version}/aarch64"
repo="${WORKSPACE}/repo"
mkdir -p "${repo}"
aws s3 sync --endpoint-url "${B2_ENDPOINT}" \\
--exclude '*' --include '*.rpm' \\
- "${repo_url}/" "${repo}/"
+ "${prefix}/" "${repo}/"
createrepo_c --update "${repo}"
aws s3 sync --endpoint-url "${B2_ENDPOINT}" \\
--exclude 'repomd.xml*' \\
- "${repo}/repodata/" "${repo_url}/repodata/"
+ "${repo}/repodata/" "${prefix}/repodata/"
aws s3 cp --endpoint-url "${B2_ENDPOINT}" \\
"${repo}/repodata/repomd.xml" \\
- "${repo_url}/repodata/repomd.xml"
+ "${prefix}/repodata/repomd.xml"
# Served next to the repository so that consumers
# can `dnf config-manager --add-repo` the URL.