summaryrefslogtreecommitdiff
path: root/.gitlab-ci
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2022-12-31 01:50:29 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2022-12-31 05:13:10 +0530
commitfc6843bec80a1d49da92620b583f2c1476815857 (patch)
tree5b470457a5fcfc5d5bec6f6b031bb3b8972a4b65 /.gitlab-ci
parenta587212080140e784fdfab254a96f4ed353a2e73 (diff)
downloadglib-fc6843bec80a1d49da92620b583f2c1476815857.tar.gz
ci: Fix podman support in run-docker.sh
In newer Fedora versions, `docker` doesn't exist. You have to use `podman`.
Diffstat (limited to '.gitlab-ci')
-rwxr-xr-x.gitlab-ci/run-docker.sh17
1 files changed, 9 insertions, 8 deletions
diff --git a/.gitlab-ci/run-docker.sh b/.gitlab-ci/run-docker.sh
index 33a0ae5d1..625f13ee7 100755
--- a/.gitlab-ci/run-docker.sh
+++ b/.gitlab-ci/run-docker.sh
@@ -15,16 +15,17 @@ read_arg() {
fi
}
-SUDO_CMD="sudo"
-if docker -v |& grep -q podman; then
+if type -p podman; then
# Using podman
- SUDO_CMD=""
+ DOCKER_CMD="podman"
# Docker is actually implemented by podman, and its OCI output
# is incompatible with some of the dockerd instances on GitLab
# CI runners.
export BUILDAH_FORMAT=docker
elif getent group docker | grep -q "\b${USER}\b"; then
- SUDO_CMD=""
+ DOCKER_CMD="docker"
+else
+ DOCKER_CMD="sudo docker"
fi
set -e
@@ -103,7 +104,7 @@ TAG="registry.gitlab.gnome.org/gnome/glib/${base}:${base_version}"
if [ $build == 1 ]; then
echo -e "\\e[1;32mBUILDING\\e[0m: ${base} as ${TAG}"
- $SUDO_CMD docker build \
+ $DOCKER_CMD build \
--build-arg HOST_USER_ID="$UID" \
--build-arg COVERITY_SCAN_PROJECT_NAME="${COVERITY_SCAN_PROJECT_NAME}" \
--build-arg COVERITY_SCAN_TOKEN="${COVERITY_SCAN_TOKEN}" \
@@ -116,16 +117,16 @@ if [ $push == 1 ]; then
echo -e "\\e[1;32mPUSHING\\e[0m: ${base} as ${TAG}"
if [ $no_login == 0 ]; then
- $SUDO_CMD docker login registry.gitlab.gnome.org
+ $DOCKER_CMD login registry.gitlab.gnome.org
fi
- $SUDO_CMD docker push $TAG
+ $DOCKER_CMD push $TAG
exit $?
fi
if [ $run == 1 ]; then
echo -e "\\e[1;32mRUNNING\\e[0m: ${base} as ${TAG}"
- $SUDO_CMD docker run \
+ $DOCKER_CMD run \
--rm \
--volume "$(pwd)/..:/home/user/app" \
--workdir "/home/user/app" \