aboutsummaryrefslogtreecommitdiffstats
path: root/meson/ci/ciimage/common.sh
diff options
context:
space:
mode:
Diffstat (limited to 'meson/ci/ciimage/common.sh')
-rw-r--r--meson/ci/ciimage/common.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/meson/ci/ciimage/common.sh b/meson/ci/ciimage/common.sh
new file mode 100644
index 000000000..707b7515f
--- /dev/null
+++ b/meson/ci/ciimage/common.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+###
+### Common functions for CI builder files.
+### All functions can be accessed in install.sh via:
+###
+### $ source /ci/common.sh
+###
+
+set -e
+set -x
+
+base_python_pkgs=(
+ pytest
+ pytest-xdist
+ coverage
+ codecov
+ jsonschema
+)
+
+python_pkgs=(
+ cython
+ gobject
+ PyGObject
+ lxml
+ gcovr
+)
+
+dub_fetch() {
+ set +e
+ for (( i=1; i<=24; ++i )); do
+ dub fetch "$@"
+ (( $? == 0 )) && break
+
+ echo "Dub Fetch failed. Retrying in $((i*5))s"
+ sleep $((i*5))
+ done
+ set -e
+}
+
+install_minimal_python_packages() {
+ python3 -m pip install "${base_python_pkgs[@]}" $*
+}
+
+install_python_packages() {
+ python3 -m pip install "${base_python_pkgs[@]}" "${python_pkgs[@]}" $*
+}