diff --git a/Makefile b/Makefile index 7c94e728..4c2be169 100644 --- a/Makefile +++ b/Makefile @@ -38,8 +38,10 @@ RELEASE_VERSION ?= $(shell git tag --points-at HEAD) # The following environment variables are assumed for MYSQL: # - MYSQL_PASSWORD: Password of the MySQL root user # - MYSQL_CMD_PREFIX: Prefix to use for all mysql commands (intended use: docker exec) -MYSQL := $(MYSQL_CMD_PREFIX) mysql -u root -p"$$MYSQL_PASSWORD" -MYSQLDUMP := $(MYSQL_CMD_PREFIX) mysqldump -u root -p"$$MYSQL_PASSWORD" +MYSQLCMD := $(shell $(MYSQL_CMD_PREFIX) sh -c 'which mariadb mysql | head -n 1') +MYSQLDUMPCMD := $(shell $(MYSQL_CMD_PREFIX) sh -c 'which mariadb-dump mysqldump | head -n 1') +MYSQL := $(MYSQL_CMD_PREFIX) $(MYSQLCMD) -u root -p"$$MYSQL_PASSWORD" +MYSQLDUMP := $(MYSQL_CMD_PREFIX) $(MYSQLDUMP) -u root -p"$$MYSQL_PASSWORD" # POSTGRES_CMD_PREFIX can be used to run the command inside a docker container # For simplicity, we assume an isolated test database that we can directly access as the postgres user with no sensitive password