-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use docker compose if docker-compose is not available,
like in the GitHub Actions runner images after the actions/runner-images#9692 change.
- Loading branch information
Jan Pazdziora
committed
Aug 5, 2024
1 parent
696a68e
commit fd6981b
Showing
1 changed file
with
13 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,35 @@ | ||
|
||
ifndef DOCKER_COMPOSE | ||
DOCKER_COMPOSE := $(shell command -v docker-compose 2> /dev/null) | ||
endif | ||
ifndef DOCKER_COMPOSE | ||
DOCKER_COMPOSE := docker compose | ||
endif | ||
|
||
build: | ||
rm -rf tests/identity | ||
cp -rp identity tests/ | ||
docker-compose -p django-identity-external -f tests/podman-compose.yml --profile test build | ||
$(DOCKER_COMPOSE) -p django-identity-external -f tests/podman-compose.yml --profile test build | ||
|
||
run: | ||
docker-compose -p django-identity-external -f tests/podman-compose.yml up & | ||
$(DOCKER_COMPOSE) -p django-identity-external -f tests/podman-compose.yml up & | ||
for i in $$( seq 1 10 ) ; do docker logs django-identity-external_setup_1 2>&1 | grep '^OK /setup' && break ; sleep 5 ; done | ||
|
||
restart-app: | ||
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 | ||
$(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 | ||
|
||
test: | ||
tests/test.pl http://www:8079/admin bob 'bobovo heslo' djadmin djnimda david 'davidovo heslo' | ||
$(MAKE) restart-app | ||
tests/test.pl http://www:8080/admin bob 'bobovo heslo' djadmin djnimda david 'davidovo heslo' | ||
|
||
test-client-container: | ||
docker-compose -p django-identity-external -f tests/podman-compose.yml --profile test run -T test-client-saml | ||
$(DOCKER_COMPOSE) -p django-identity-external -f tests/podman-compose.yml --profile test run -T test-client-saml | ||
$(MAKE) restart-app | ||
docker-compose -p django-identity-external -f tests/podman-compose.yml --profile test run -T test-client-openidc | ||
$(DOCKER_COMPOSE) -p django-identity-external -f tests/podman-compose.yml --profile test run -T test-client-openidc | ||
|
||
stop: | ||
docker-compose -p django-identity-external -f tests/podman-compose.yml down -v | ||
$(DOCKER_COMPOSE) -p django-identity-external -f tests/podman-compose.yml down -v | ||
|
||
.PHONY: build run restart-app test test-client-container stop | ||
|