mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-03 05:03:43 +08:00
option to use Podman instead of Docker when running unit tests
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
# --with-pgsql: run tests with PostgreSQL, otherwise SQLite is used.
|
||||
# --no-tty: don't use tty for containers
|
||||
# --sudo: run Docker via sudo
|
||||
# --podman: use Podman instead of Docker
|
||||
# --no-pull: don't update Docker images
|
||||
#
|
||||
# Please note that, both of them can have arbitrary value as long as one of
|
||||
@@ -22,6 +23,7 @@ enable_py3=
|
||||
with_pgsql=
|
||||
no_tty=
|
||||
use_sudo=
|
||||
use_podman=
|
||||
do_pull=1
|
||||
|
||||
while (( "$#" )); do
|
||||
@@ -30,6 +32,7 @@ while (( "$#" )); do
|
||||
--with-pgsql) with_pgsql=1 ;;
|
||||
--no-tty) no_tty=1 ;;
|
||||
--sudo) use_sudo=1 ;;
|
||||
--podman) use_podman=1 ;;
|
||||
--no-pull) do_pull= ;;
|
||||
*) break ;;
|
||||
esac
|
||||
@@ -58,7 +61,9 @@ fi
|
||||
if [ -n "$with_pgsql" ]; then
|
||||
test_container_name="${test_container_name}-pgsql"
|
||||
fi
|
||||
if [ -n "$use_sudo" ]; then
|
||||
if [ -n "$use_podman" ]; then
|
||||
docker="podman"
|
||||
elif [ -n "$use_sudo" ]; then
|
||||
# use sudo for docker
|
||||
docker="sudo /usr/bin/docker"
|
||||
else
|
||||
|
||||
@@ -31,6 +31,7 @@ There are options to change the tests enviornment:
|
||||
* ``--with-pgsql``: run tests with PostgreSQL database.
|
||||
* ``--no-tty``: don't use tty for containers
|
||||
* ``--sudo``: run Docker via sudo
|
||||
* ``--podman``: use Podman instead of Docker
|
||||
* ``--no-pull``: don't update Docker images
|
||||
|
||||
For example, ``contrib/run-unittests.sh --py3 --with-pgsql``.
|
||||
|
||||
Reference in New Issue
Block a user