mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
cirrus: Generate jobs dynamically
Instead of having static job definitions for FreeBSD and macOS, use a generic template for both and fill in the details that are actually different, such as the list of packages to install, in the GitLab CI job, right before calling cirrus-run. The target-specific information are provided by lcitool, so that keeping them up to date is just a matter of running the refresh script when necessary. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
26
ci/cirrus/build.yml
Normal file
26
ci/cirrus/build.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
@CIRRUS_VM_INSTANCE_TYPE@:
|
||||
@CIRRUS_VM_IMAGE_SELECTOR@: @CIRRUS_VM_IMAGE_NAME@
|
||||
|
||||
env:
|
||||
CI_REPOSITORY_URL: "@CI_REPOSITORY_URL@"
|
||||
CI_COMMIT_REF_NAME: "@CI_COMMIT_REF_NAME@"
|
||||
CI_COMMIT_SHA: "@CI_COMMIT_SHA@"
|
||||
PATH: "@PATH@"
|
||||
PKG_CONFIG_PATH: "@PKG_CONFIG_PATH@"
|
||||
PYTHON: "@PYTHON@"
|
||||
MAKE: "@MAKE@"
|
||||
|
||||
build_task:
|
||||
install_script:
|
||||
- @INSTALL_COMMAND@ @PKGS@
|
||||
clone_script:
|
||||
- git clone --depth 100 "$CI_REPOSITORY_URL" .
|
||||
- git fetch origin "$CI_COMMIT_REF_NAME"
|
||||
- git reset --hard "$CI_COMMIT_SHA"
|
||||
build_script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- ../autogen.sh --prefix=$(pwd)/install-root
|
||||
- $MAKE -j3
|
||||
- $MAKE -j3 install
|
||||
- $MAKE -j3 dist
|
||||
@@ -1,73 +0,0 @@
|
||||
freebsd_instance:
|
||||
image_family: freebsd-12-1
|
||||
|
||||
env:
|
||||
CI_REPOSITORY_URL: {{ CI_REPOSITORY_URL }}
|
||||
CI_COMMIT_REF_NAME: {{ CI_COMMIT_REF_NAME }}
|
||||
CI_COMMIT_SHA: {{ CI_COMMIT_SHA }}
|
||||
|
||||
freebsd_12_task:
|
||||
install_script:
|
||||
- pkg install -y
|
||||
augeas
|
||||
autoconf
|
||||
automake
|
||||
avahi
|
||||
bash
|
||||
bash-completion
|
||||
ca_root_nss
|
||||
ccache
|
||||
chrony
|
||||
cppi
|
||||
curl
|
||||
cyrus-sasl
|
||||
dbus
|
||||
diskscrub
|
||||
dnsmasq
|
||||
fusefs-libs
|
||||
gdb
|
||||
gettext
|
||||
gettext-tools
|
||||
git
|
||||
glib
|
||||
gmake
|
||||
gnutls
|
||||
hal
|
||||
libpcap
|
||||
libpciaccess
|
||||
libssh
|
||||
libssh2
|
||||
libtool
|
||||
libxml2
|
||||
libxslt
|
||||
lsof
|
||||
meson
|
||||
ncurses
|
||||
ninja
|
||||
patch
|
||||
perl5
|
||||
pkgconf
|
||||
polkit
|
||||
py37-docutils
|
||||
py37-flake8
|
||||
py37-setuptools
|
||||
py37-wheel
|
||||
python3
|
||||
qemu-utils
|
||||
radvd
|
||||
readline
|
||||
screen
|
||||
sudo
|
||||
vim
|
||||
yajl
|
||||
clone_script:
|
||||
- git clone --depth 100 "$CI_REPOSITORY_URL" .
|
||||
- git fetch origin "$CI_COMMIT_REF_NAME"
|
||||
- git reset --hard "$CI_COMMIT_SHA"
|
||||
build_script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- ../autogen.sh --prefix=$(pwd)/install-root
|
||||
- gmake -j3
|
||||
- gmake -j3 install
|
||||
- gmake -j3 dist
|
||||
7
ci/cirrus/libvirt-freebsd-12.vars
Normal file
7
ci/cirrus/libvirt-freebsd-12.vars
Normal file
@@ -0,0 +1,7 @@
|
||||
PACKAGING_COMMAND='pkg'
|
||||
CC='/usr/bin/clang'
|
||||
CCACHE='/usr/local/bin/ccache'
|
||||
MAKE='/usr/local/bin/gmake'
|
||||
NINJA='/usr/local/bin/ninja'
|
||||
PYTHON='/usr/local/bin/python3'
|
||||
PKGS='augeas autoconf automake avahi bash bash-completion ca_root_nss ccache chrony cppi curl cyrus-sasl dbus diskscrub dnsmasq fusefs-libs gdb gettext gettext-tools git glib gmake gnutls hal libpcap libpciaccess libssh libssh2 libtool libxml2 libxslt lsof meson ncurses ninja p5-App-cpanminus patch perl5 pkgconf polkit py37-docutils py37-flake8 py37-pip py37-setuptools py37-wheel python3 qemu-utils radvd readline screen sudo vim yajl'
|
||||
7
ci/cirrus/libvirt-macos-1015.vars
Normal file
7
ci/cirrus/libvirt-macos-1015.vars
Normal file
@@ -0,0 +1,7 @@
|
||||
PACKAGING_COMMAND='brew'
|
||||
CC='/usr/bin/clang'
|
||||
CCACHE='/usr/local/bin/ccache'
|
||||
MAKE='/usr/local/bin/gmake'
|
||||
NINJA='/usr/local/bin/ninja'
|
||||
PYTHON='/usr/local/bin/python3'
|
||||
PKGS='augeas autoconf automake bash bash-completion ccache cpanminus cppi curl dbus dnsmasq docutils flake8 gdb gettext git glib gnutls gpatch libiscsi libpcap libssh libssh2 libtool libxml2 libxslt lsof make meson ncurses ninja perl pkg-config python3 qemu readline rpcgen screen scrub vim xz yajl'
|
||||
@@ -1,38 +0,0 @@
|
||||
osx_instance:
|
||||
image: catalina-base
|
||||
|
||||
env:
|
||||
CI_REPOSITORY_URL: {{ CI_REPOSITORY_URL }}
|
||||
CI_COMMIT_REF_NAME: {{ CI_COMMIT_REF_NAME }}
|
||||
CI_COMMIT_SHA: {{ CI_COMMIT_SHA }}
|
||||
PATH: /usr/local/opt/gettext/bin:/usr/local/opt/ccache/libexec:/usr/local/opt/rpcgen/bin:$PATH
|
||||
PKG_CONFIG_PATH: /usr/local/opt/libxml2/lib/pkgconfig
|
||||
|
||||
macos_1015_task:
|
||||
install_script:
|
||||
- brew install
|
||||
autoconf
|
||||
automake
|
||||
ccache
|
||||
docutils
|
||||
glib
|
||||
gnutls
|
||||
libtool
|
||||
libxml2
|
||||
make
|
||||
pkg-config
|
||||
python
|
||||
rpcgen
|
||||
xz
|
||||
yajl
|
||||
clone_script:
|
||||
- git clone --depth 100 "$CI_REPOSITORY_URL" .
|
||||
- git fetch origin "$CI_COMMIT_REF_NAME"
|
||||
- git reset --hard "$CI_COMMIT_SHA"
|
||||
build_script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- ../autogen.sh --prefix=$(pwd)/install-root
|
||||
- gmake -j3
|
||||
- gmake -j3 install
|
||||
- gmake -j3 dist
|
||||
22
ci/cirrus/refresh
Executable file
22
ci/cirrus/refresh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
if test -z "$1"
|
||||
then
|
||||
echo "syntax: $0 PATH-TO-LCITOOL"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LCITOOL=$1
|
||||
|
||||
if ! test -x "$LCITOOL"
|
||||
then
|
||||
echo "$LCITOOL is not executable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
HOSTS=$($LCITOOL hosts | grep -E 'freebsd-12|macos')
|
||||
|
||||
for host in $HOSTS
|
||||
do
|
||||
$LCITOOL variables "$host" libvirt >"$host.vars"
|
||||
done
|
||||
Reference in New Issue
Block a user