Skip to content

Commit fd6981b

Browse files
author
Jan Pazdziora
committed
Use docker compose if docker-compose is not available,
like in the GitHub Actions runner images after the actions/runner-images#9692 change.
1 parent 696a68e commit fd6981b

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

Makefile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
11

2+
ifndef DOCKER_COMPOSE
3+
DOCKER_COMPOSE := $(shell command -v docker-compose 2> /dev/null)
4+
endif
5+
ifndef DOCKER_COMPOSE
6+
DOCKER_COMPOSE := docker compose
7+
endif
8+
29
build:
310
rm -rf tests/identity
411
cp -rp identity tests/
5-
docker-compose -p django-identity-external -f tests/podman-compose.yml --profile test build
12+
$(DOCKER_COMPOSE) -p django-identity-external -f tests/podman-compose.yml --profile test build
613

714
run:
8-
docker-compose -p django-identity-external -f tests/podman-compose.yml up &
15+
$(DOCKER_COMPOSE) -p django-identity-external -f tests/podman-compose.yml up &
916
for i in $$( seq 1 10 ) ; do docker logs django-identity-external_setup_1 2>&1 | grep '^OK /setup' && break ; sleep 5 ; done
1017

1118
restart-app:
12-
docker-compose -p django-identity-external -f tests/podman-compose.yml exec -T app cp /var/www/django/project/db.sqlite3.initial /var/www/django/project/db.sqlite3
19+
$(DOCKER_COMPOSE) -p django-identity-external -f tests/podman-compose.yml exec -T app cp /var/www/django/project/db.sqlite3.initial /var/www/django/project/db.sqlite3
1320

1421
test:
1522
tests/test.pl http://www:8079/admin bob 'bobovo heslo' djadmin djnimda david 'davidovo heslo'
1623
$(MAKE) restart-app
1724
tests/test.pl http://www:8080/admin bob 'bobovo heslo' djadmin djnimda david 'davidovo heslo'
1825

1926
test-client-container:
20-
docker-compose -p django-identity-external -f tests/podman-compose.yml --profile test run -T test-client-saml
27+
$(DOCKER_COMPOSE) -p django-identity-external -f tests/podman-compose.yml --profile test run -T test-client-saml
2128
$(MAKE) restart-app
22-
docker-compose -p django-identity-external -f tests/podman-compose.yml --profile test run -T test-client-openidc
29+
$(DOCKER_COMPOSE) -p django-identity-external -f tests/podman-compose.yml --profile test run -T test-client-openidc
2330

2431
stop:
25-
docker-compose -p django-identity-external -f tests/podman-compose.yml down -v
32+
$(DOCKER_COMPOSE) -p django-identity-external -f tests/podman-compose.yml down -v
2633

2734
.PHONY: build run restart-app test test-client-container stop
2835

0 commit comments

Comments
 (0)