[libvirt PATCH 2/3] cirrus: Add templates and refresh script

Andrea Bolognani abologna at redhat.com
Mon Jun 29 13:58:43 UTC 2020


This is similar to what we already use for Dockerfiles, with one
key difference: while we still rely on lcitool taking care of the
complicated work for us, in this case we're only provided with a
bunch of variables and we have to do the last bit of work (that
is replacing them inside an existing template) ourselves.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 ci/cirrus/refresh                  | 32 ++++++++++++++++++++++++++++++
 ci/cirrus/templates/freebsd-12.yml | 25 +++++++++++++++++++++++
 ci/cirrus/templates/macos-1015.yml | 27 +++++++++++++++++++++++++
 3 files changed, 84 insertions(+)
 create mode 100755 ci/cirrus/refresh
 create mode 100644 ci/cirrus/templates/freebsd-12.yml
 create mode 100644 ci/cirrus/templates/macos-1015.yml

diff --git a/ci/cirrus/refresh b/ci/cirrus/refresh
new file mode 100755
index 0000000000..51deca94ac
--- /dev/null
+++ b/ci/cirrus/refresh
@@ -0,0 +1,32 @@
+#!/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
+
+for infile in templates/*
+do
+    outfile="${infile##*/}.j2"
+    host="${outfile%%.*}"
+
+    eval $("$LCITOOL" dockerfile "libvirt-$host" libvirt --variables)
+
+    sed -e "s|[@]PKGS@|$PKGS|g" \
+        -e "s|[@]CROSS_PKGS@|$CROSS_PKGS|g" \
+        -e "s|[@]PYPI_PKGS@|$PYPI_PKGS|g" \
+        -e "s|[@]CPAN_PKGS@|$CPAN_PKGS|g" \
+        -e "s|[@]MAKE@|$MAKE|g" \
+        -e "s|[@]NINJA@|$NINJA|g" \
+        -e "s|[@]PYTHON@|$PYTHON|g" \
+        <"$infile" >"$outfile"
+done
diff --git a/ci/cirrus/templates/freebsd-12.yml b/ci/cirrus/templates/freebsd-12.yml
new file mode 100644
index 0000000000..228ea67827
--- /dev/null
+++ b/ci/cirrus/templates/freebsd-12.yml
@@ -0,0 +1,25 @@
+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 }}
+  PKGS: @PKGS@
+  MAKE: @MAKE@
+  PYTHON: @PYTHON@
+
+freebsd_12_task:
+  install_script:
+    - pkg install -y $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
diff --git a/ci/cirrus/templates/macos-1015.yml b/ci/cirrus/templates/macos-1015.yml
new file mode 100644
index 0000000000..5fba3c635b
--- /dev/null
+++ b/ci/cirrus/templates/macos-1015.yml
@@ -0,0 +1,27 @@
+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/ccache/libexec:/usr/local/opt/gettext/bin:/usr/local/opt/libpcap/bin:/usr/local/opt/libxslt/bin:/usr/local/opt/rpcgen/bin:$PATH
+  PKG_CONFIG_PATH: /usr/local/opt/curl/lib/pkgconfig:/usr/local/opt/libpcap/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig:/usr/local/opt/ncurses/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig
+  PKGS: @PKGS@
+  MAKE: @MAKE@
+  PYTHON: @PYTHON@
+
+macos_1015_task:
+  install_script:
+    - brew install $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
-- 
2.25.4




More information about the libvir-list mailing list