debs : add generic PPA publish role, switch openafs to it
Use the generic role from I11e2bdcbf2894d86105d75c3d3580aefb6aa18fc and make a generic publishing role too. Remove the openafs specific bits that are no longer used. Move the description of the OpenAFS jobs above the job definition. Change-Id: Ie61b82903644605d07f510ad1071fa551e7086c9
This commit is contained in:
parent
f4ab3e465e
commit
b48bf53f49
playbooks/openafs-deb-package-build
roles
zuul.d
@ -1,57 +1,5 @@
|
||||
- hosts: all
|
||||
tasks:
|
||||
|
||||
- name: Install PPA private key
|
||||
include_role:
|
||||
name: add-gpgkey
|
||||
|
||||
- name: Download source package artifacts
|
||||
include_role:
|
||||
name: download-artifact
|
||||
roles:
|
||||
- role: infra-deb-ppa-push
|
||||
vars:
|
||||
download_artifact_api: "https://zuul.opendev.org/api/tenant/{{ zuul.tenant }}"
|
||||
download_artifact_type: deb.tar.gz
|
||||
download_artifact_pipeline: gate
|
||||
download_artifact_job: openafs-deb-package-build
|
||||
download_artifact_directory: '{{ ansible_user_dir }}'
|
||||
|
||||
- name: Extract sources
|
||||
unarchive:
|
||||
src: '{{ ansible_user_dir }}/openafs-debs.tar.gz'
|
||||
dest: '{{ ansible_user_dir }}'
|
||||
remote_src: yes
|
||||
|
||||
- name: Find changes files
|
||||
find:
|
||||
paths: '{{ ansible_user_dir }}/openafs'
|
||||
patterns: '*.changes'
|
||||
register: _changes_files
|
||||
|
||||
- name: Install dependencies
|
||||
package:
|
||||
name:
|
||||
- devscripts
|
||||
- dput
|
||||
become: yes
|
||||
|
||||
- name: Sign changes file
|
||||
shell: |
|
||||
debsign -k "{{ gpg_key.key_id }}" -S --debs-dir "{{ zuul.executor.work_root }}" "{{ item }}"
|
||||
loop: "{{ _changes_files.files | map(attribute='path') | list }}"
|
||||
|
||||
- name: Setup dput config
|
||||
copy:
|
||||
dest: '{{ ansible_user_dir }}/.dput.cf'
|
||||
content: |
|
||||
[ppa-openafs]
|
||||
fqdn = ppa.launchpad.net
|
||||
method = ftp
|
||||
incoming = ~openstack-ci-core/ubuntu/openafs-deb-test
|
||||
login = anonymous
|
||||
|
||||
- name: Push files to PPA
|
||||
shell: |
|
||||
dput ppa-openafs {{ item | basename }}
|
||||
args:
|
||||
chdir: '{{ ansible_user_dir }}/openafs'
|
||||
loop: "{{ _changes_files.files | map(attribute='path') | list }}"
|
||||
infra_deb_project: 'openafs'
|
||||
|
@ -1,3 +1,5 @@
|
||||
- hosts: all
|
||||
roles:
|
||||
- openafs-deb-package-build
|
||||
- role: infra-deb-package-build
|
||||
vars:
|
||||
infra_dev_projet: 'openafs'
|
||||
|
1
roles/infra-deb-ppa-push/README.rst
Normal file
1
roles/infra-deb-ppa-push/README.rst
Normal file
@ -0,0 +1 @@
|
||||
This job is designed to sign and push changes to the OpenDev Infra PPAs
|
54
roles/infra-deb-ppa-push/tasks/main.yaml
Normal file
54
roles/infra-deb-ppa-push/tasks/main.yaml
Normal file
@ -0,0 +1,54 @@
|
||||
- name: Install PPA private key
|
||||
include_role:
|
||||
name: add-gpgkey
|
||||
|
||||
- name: Download source package artifacts
|
||||
include_role:
|
||||
name: download-artifact
|
||||
vars:
|
||||
download_artifact_api: "https://zuul.opendev.org/api/tenant/{{ zuul.tenant }}"
|
||||
download_artifact_type: deb.tar.gz
|
||||
download_artifact_pipeline: gate
|
||||
download_artifact_job: '{{ infra_deb_project }}-deb-package-build'
|
||||
download_artifact_directory: '{{ ansible_user_dir }}'
|
||||
|
||||
- name: Extract sources
|
||||
unarchive:
|
||||
src: '{{ ansible_user_dir }}/{{ infra_deb_project }}-debs.tar.gz'
|
||||
dest: '{{ ansible_user_dir }}'
|
||||
remote_src: yes
|
||||
|
||||
- name: Find changes files
|
||||
find:
|
||||
paths: '{{ ansible_user_dir }}/{{ infra_deb_project }}'
|
||||
patterns: '*.changes'
|
||||
register: _changes_files
|
||||
|
||||
- name: Install dependencies
|
||||
package:
|
||||
name:
|
||||
- devscripts
|
||||
- dput
|
||||
become: yes
|
||||
|
||||
- name: Sign changes file
|
||||
shell: |
|
||||
debsign -k "{{ gpg_key.key_id }}" -S --debs-dir "{{ zuul.executor.work_root }}" "{{ item }}"
|
||||
loop: "{{ _changes_files.files | map(attribute='path') | list }}"
|
||||
|
||||
- name: Setup dput config
|
||||
copy:
|
||||
dest: '{{ ansible_user_dir }}/.dput.cf'
|
||||
content: |
|
||||
[ppa-opendev]
|
||||
fqdn = ppa.launchpad.net
|
||||
method = ftp
|
||||
incoming = ~openstack-ci-core/ubuntu/{{ infra_deb_project }}-deb-test
|
||||
login = anonymous
|
||||
|
||||
- name: Push files to PPA
|
||||
shell: |
|
||||
dput ppa-opendev {{ item | basename }}
|
||||
args:
|
||||
chdir: '{{ ansible_user_dir }}/{{ infra_deb_project }}'
|
||||
loop: "{{ _changes_files.files | map(attribute='path') | list }}"
|
@ -1,26 +0,0 @@
|
||||
Build OpenAFS Ubuntu Packages
|
||||
|
||||
This builds openafs source packages and, with the publishing steps,
|
||||
pushes them to be built by as an Ubuntu PPA.
|
||||
|
||||
OpenDev has traditionally kept separate OpenAFS packages in a PPA
|
||||
which are used by production hosts. In the past the LTS distro
|
||||
versions have had bugs, or lacked support for architectures/kernels
|
||||
(ARM64 + HWE kernels, practically) we needed -- necessitating keeping
|
||||
separate, fresh versions.
|
||||
|
||||
Upstream packages keep a PPA at
|
||||
https://launchpad.net/~openafs/+archive/ubuntu/stable
|
||||
|
||||
As much as possible, we generally import and use their debian/*
|
||||
infrastructure (including patches, etc.) as a base here. This PPA
|
||||
doesn't build all the architectures we need, but also isn't focused on
|
||||
the immediate needs of OpenDev production; thus despite it's regular
|
||||
maintence it is still helpful for us to have our own package builds.
|
||||
|
||||
These problems are much less with current distros (>= 2022) and
|
||||
openafs 1.8 series; our goal is to generally carry no differences.
|
||||
|
||||
Note the openafs-rpm-package-build jobs are a counter-part to this, as
|
||||
OpenAFS hasn't been available on RPM distros. We try to keep these in
|
||||
sync so our infrastructure is more or less at the same level.
|
@ -1,72 +0,0 @@
|
||||
- name: Install prereqs
|
||||
package:
|
||||
name:
|
||||
- build-essential
|
||||
- devscripts
|
||||
- dpkg-dev
|
||||
- equivs # for mk-build-deps
|
||||
become: yes
|
||||
|
||||
- name: Make working directory
|
||||
file:
|
||||
path: '{{ ansible_user_dir }}/openafs'
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Build source
|
||||
args:
|
||||
executable: '/bin/bash'
|
||||
shell: |
|
||||
set -eux
|
||||
|
||||
# make the orig
|
||||
pushd '{{ zuul.project.src_dir }}'
|
||||
./make-orig.sh
|
||||
|
||||
# this puts a file with the version for us to use
|
||||
VERSION=$(cat ./version)
|
||||
|
||||
# copy the result and the debian/* directory to build area
|
||||
cp openafs_${VERSION}.orig.tar.xz '{{ ansible_user_dir }}/openafs'
|
||||
cp -r debian '{{ ansible_user_dir }}/openafs'
|
||||
popd
|
||||
|
||||
pushd openafs
|
||||
|
||||
# extract source and move into place
|
||||
tar xf openafs_${VERSION}.orig.tar.xz
|
||||
mv debian ./openafs_${VERSION}.orig
|
||||
|
||||
pushd openafs_${VERSION}.orig
|
||||
|
||||
# install build deps
|
||||
mk-build-deps --install --root-cmd sudo --remove -t "apt-get -y"
|
||||
# build source packages
|
||||
debuild -S -sa --no-sign
|
||||
|
||||
popd
|
||||
|
||||
# clean up orig source from build
|
||||
rm -rf openafs_${VERSION}.orig
|
||||
|
||||
popd
|
||||
|
||||
# create omnibus tar file
|
||||
tar czf openafs-debs.tar.gz ./openafs
|
||||
|
||||
- name: Copy built packages
|
||||
synchronize:
|
||||
src: '{{ ansible_user_dir }}/openafs-debs.tar.gz'
|
||||
dest: '{{ zuul.executor.log_root }}'
|
||||
mode: pull
|
||||
|
||||
- name: Return build artifact
|
||||
zuul_return:
|
||||
data:
|
||||
zuul:
|
||||
artifacts:
|
||||
- name: deb-tar
|
||||
url: openafs-debs.tar.gz
|
||||
metadata:
|
||||
type: deb.tar.gz
|
||||
|
@ -1394,6 +1394,30 @@
|
||||
nodeset:
|
||||
nodes: []
|
||||
|
||||
# This builds openafs source packages and, with the publishing steps,
|
||||
# pushes them to be built by as an Ubuntu PPA.
|
||||
#
|
||||
# OpenDev has traditionally kept separate OpenAFS packages in a PPA
|
||||
# which are used by production hosts. In the past the LTS distro
|
||||
# versions have had bugs, or lacked support for architectures/kernels
|
||||
# (ARM64 + HWE kernels, practically) we needed -- necessitating keeping
|
||||
# separate, fresh versions.
|
||||
#
|
||||
# Upstream packages keep a PPA at
|
||||
# https://launchpad.net/~openafs/+archive/ubuntu/stable
|
||||
#
|
||||
# As much as possible, we generally import and use their debian/*
|
||||
# infrastructure (including patches, etc.) as a base. This PPA
|
||||
# doesn't build all the architectures we need, but also isn't focused
|
||||
# on the immediate needs of OpenDev production; thus despite it's
|
||||
# regular maintence it is still helpful for us to have our own package
|
||||
# builds. These problems are much less with current distros (>= 2022)
|
||||
# and openafs 1.8 series; our goal is to generally carry no
|
||||
# differences.
|
||||
#
|
||||
# Note the openafs-rpm-package-build jobs are a counter-part to this, as
|
||||
# OpenAFS hasn't been available on RPM distros. We try to keep these in
|
||||
# sync so our infrastructure is more or less at the same level.
|
||||
- job:
|
||||
name: openafs-deb-package-build
|
||||
description: |
|
||||
|
Loading…
x
Reference in New Issue
Block a user