Enable podman-compose

By default Makefile used docker.
Added command to execute podman-compose if it's present.

Depends-On: https://review.opendev.org/c/opendev/elastic-recheck/+/841306

Change-Id: I8379f313b96c4884766c5af4179d5e4721e8c2b2
This commit is contained in:
Dariusz Smigiel 2022-05-09 14:56:33 -07:00 committed by dasm
parent 831d4ed3df
commit 7780f975a8
1 changed files with 4 additions and 2 deletions

View File

@ -4,6 +4,8 @@ PYTHON ?= $(shell command -v python3 python|head -n1)
# Keep docker before podman due to:
# https://github.com/containers/podman/issues/7602
ENGINE ?= $(shell command -v docker podman|head -n1)
COMPOSE ?= $(shell command -v docker-compose podman-compose|head -n1)
# localhost/ prefix must be present in order to assure docker/podman compatibility:
# https://github.com/containers/buildah/issues/1034
IMAGE_TAG=localhost/elastic-recheck
@ -56,14 +58,14 @@ up: data/id_rsa check-env ## Run containers
@# Validate the builder image can connect to server
@# $(ENGINE) run --env GERRIT_USER -it $(IMAGE_TAG) python3 /root/ssh-check.py
@# --abort-on-container-exit
docker-compose up --force-recreate --remove-orphans --abort-on-container-exit <<<y
$(COMPOSE) up --force-recreate --remove-orphans --abort-on-container-exit <<<y
@# docker container stop elastic-recheck
@# bash -c "docker rm elastic-recheck || true"
@# docker run --env ES_URL --env LS_URL --env DB_URI --env GERRIT_HOST --env GERRIT_USER --env IRC_NICK --env IRC_PASS -it --name elastic-recheck elastic-recheck:latest
.PHONY: down
down: ## Destroy containers
docker-compose down --remove-orphans --rmi local
$(COMPOSE) down --remove-orphans --rmi local
.PHONY: into
into: ## Starts bash inside docker image