openafs-rpm-package-build: new package build roles

The extant roles are not really right.  They run in periodic and poll
tarballs to see if they should build anything.  They are not gate
tested.  I do not know why I did it like this; but it was a long time
ago.

We should have roles that build in the check gate, and upload only
when the client version changes.

Additionally, I found that the upstream .srpm we were building from is
not quite right; it won't build on ARM64 for example due to the way
it's autoconf machinery has been generated.  The best way is to build
your own srpm from the upstream source using the method linked in this
change.

This builds and publishes artifacts for centos7 x86 and centos8
arm64/x86.  A follow-on will publish these.

Change-Id: Iefb01ba48a457388bb5412ddad3d7dafb00d620c
This commit is contained in:
Ian Wienand 2020-06-02 15:15:33 +10:00
parent b98f4ded64
commit 2faed0d4c2
5 changed files with 110 additions and 0 deletions

View File

@ -0,0 +1,3 @@
- hosts: all
roles:
- openafs-rpm-package-build

View File

@ -0,0 +1,3 @@
Build OpenAFS RPM packages
This builds RPM packages for openafs

View File

@ -0,0 +1,75 @@
- name: Install prereqs
package:
name:
- rpm-build
- kernel-devel
- createrepo
become: yes
- name: Install centos8 packages
package:
name:
- elfutils-devel
become: yes
when: ansible_distribution_major_version == '8'
# https://wiki.openafs.org/devel/HowToBuildOpenAfsRpmPackages/
- name: Build and install srpm
environment:
PACKAGER: "{{ (ansible_distribution_major_version == '7') | ternary('yum', 'dnf') }}"
shell: |
set -eux
VERSION=1.8.5
mkdir openafs
wget https://www.openafs.org/dl/openafs/${VERSION}/openafs-${VERSION}-src.tar.bz2
wget https://www.openafs.org/dl/openafs/${VERSION}/openafs-${VERSION}-doc.tar.bz2
wget https://www.openafs.org/dl/openafs/${VERSION}/RELNOTES-${VERSION}
wget https://www.openafs.org/dl/openafs/${VERSION}/ChangeLog
# Build the source RPM.
tar xf openafs-${VERSION}-src.tar.bz2 --strip-components=4 '*/makesrpm.pl'
perl makesrpm.pl openafs-${VERSION}-src.tar.bz2 openafs-${VERSION}-doc.tar.bz2 RELNOTES-${VERSION} ChangeLog
if [[ ${PACKAGER} == "yum" ]]; then
sudo yum-builddep -y openafs-${VERSION}-1.src.rpm
else
sudo dnf builddep -y openafs-${VERSION}-1.src.rpm
fi
rpm -i openafs-${VERSION}-1.src.rpm
pushd ~/rpmbuild/SPECS
rpmbuild -ba ./openafs.spec
popd
# create final repo
createrepo ~/rpmbuild/RPMS/{{ ansible_architecture }}
- name: Copy built rpms
synchronize:
src: '{{ ansible_user_dir }}/rpmbuild/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
rsync_opts:
- --include=/RPMS/**
- --include=/SRPMS/**
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Return build artifact
zuul_return:
data:
zuul:
artifacts:
- name: rpms
url: RPMS
metadata:
type: rpm
- name: srpms
url: SRPMS
metadata:
type: srpm

View File

@ -1021,6 +1021,32 @@
tox_envlist: infra-docs
sphinx_build_dir: docs-site
- job:
name: openafs-rpm-package-build
description: |
There are no official builds for AFS on Centos, hence we build
our own and publish them to tarballs.openstack.org for our
centos hosts that need access to the mirror to consume.
run: playbooks/openafs-rpm-package-build/run.yaml
files:
- playbooks/openafs-rpm-package-build
- roles/openafs-rpm-package-build
- job:
name: openafs-rpm-package-build-centos-7-x86
parent: openafs-rpm-package-build
nodeset: centos-7
- job:
name: openafs-rpm-package-build-centos-8-x86
parent: openafs-rpm-package-build
nodeset: centos-8
- job:
name: openafs-rpm-package-build-centos-8-arm64
parent: openafs-rpm-package-build
nodeset: centos-8-arm64
- job:
name: project-config-build-openafs-centos
description: |

View File

@ -5,6 +5,9 @@
check:
jobs:
- openafs-rpm-package-build-centos-7-x86
- openafs-rpm-package-build-centos-8-x86
- openafs-rpm-package-build-centos-8-arm64
- openstack-infra-extra-integration-xenial
- openstack-infra-extra-integration-bionic
- openstack-zuul-jobs-linters