From 8cfa787827a1e8098141a4c619d5cf8c53b8140c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Mei=C3=9Fner?= Date: Sun, 3 Nov 2024 14:34:17 +0100 Subject: [PATCH 1/4] Modify version request for docker command details --- tests/docker/setup_database.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/docker/setup_database.sh b/tests/docker/setup_database.sh index 0ba763a..b34b082 100644 --- a/tests/docker/setup_database.sh +++ b/tests/docker/setup_database.sh @@ -1,6 +1,6 @@ #!/bin/bash -if grep -q podman <<< $(docker --version 2> /dev/null) ; then +if grep -iq podman <<< $(docker version 2> /dev/null) ; then echo "Podman is installed" DOCKER_CMD=$(which podman) fi From 4f9456b215018e5a050306367b0c35920f21205d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Mei=C3=9Fner?= Date: Sat, 11 Jan 2025 11:10:02 +0100 Subject: [PATCH 2/4] fixed setup db to reflect podman container names --- tests/docker/setup_database.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/docker/setup_database.sh b/tests/docker/setup_database.sh index b34b082..f9c6293 100644 --- a/tests/docker/setup_database.sh +++ b/tests/docker/setup_database.sh @@ -13,7 +13,7 @@ done echo "Database is up" echo "Creating database ${DB_NAME:-phpipam}" -${DOCKER_CMD} exec -ti docker_phpipam_1 sh -c 'mysql -h database -u phpipam -pphpipamadmin phpipam < /phpipam/db/SCHEMA.sql' +${DOCKER_CMD} exec -ti docker-phpipam-1 sh -c 'mysql -h database -u phpipam -pphpipamadmin phpipam < /phpipam/db/SCHEMA.sql' echo "Activating API" mysql -u phpipam -pphpipamadmin -h "${DB_HOST:-127.0.0.1}" phpipam --execute="UPDATE settings SET api=1 WHERE id=1;" From b9ae42b5932259da459b23169adf579973240a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Mei=C3=9Fner?= Date: Sat, 11 Jan 2025 11:28:35 +0100 Subject: [PATCH 3/4] set explicit container name for test containers --- tests/docker/docker-compose.yml | 2 ++ tests/docker/setup_database.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/docker/docker-compose.yml b/tests/docker/docker-compose.yml index 92c7b89..2596560 100644 --- a/tests/docker/docker-compose.yml +++ b/tests/docker/docker-compose.yml @@ -11,6 +11,7 @@ services: IPAM_DATABASE_NAME: "phpipam" depends_on: - database + container_name: phpipam_test_webserver database: image: mariadb:10.3.18 ports: @@ -20,3 +21,4 @@ services: MYSQL_USER: "phpipam" MYSQL_PASSWORD: "phpipamadmin" MYSQL_DATABASE: "phpipam" + container_name: phpipam_test_db diff --git a/tests/docker/setup_database.sh b/tests/docker/setup_database.sh index f9c6293..ffb2d03 100644 --- a/tests/docker/setup_database.sh +++ b/tests/docker/setup_database.sh @@ -13,7 +13,7 @@ done echo "Database is up" echo "Creating database ${DB_NAME:-phpipam}" -${DOCKER_CMD} exec -ti docker-phpipam-1 sh -c 'mysql -h database -u phpipam -pphpipamadmin phpipam < /phpipam/db/SCHEMA.sql' +${DOCKER_CMD} exec -ti phpipam_test_webserver sh -c 'mysql -h database -u phpipam -pphpipamadmin phpipam < /phpipam/db/SCHEMA.sql' echo "Activating API" mysql -u phpipam -pphpipamadmin -h "${DB_HOST:-127.0.0.1}" phpipam --execute="UPDATE settings SET api=1 WHERE id=1;" From c620d59a3f42ba3c57dd8d3e351f8b300ac67a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Mei=C3=9Fner?= Date: Sun, 12 Jan 2025 11:24:57 +0100 Subject: [PATCH 4/4] Fix issues with starting docker-compose in CI (#125) * upgrade `docker-compose` before run phpipam-action * pin python to version 3.9 as long we did not found time to test newer versions --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 23ea58f..95e411a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,6 +10,8 @@ jobs: matrix: phpipam-version: ['v1.4x', 'v1.5x'] steps: + - name: Upgrade docker-compose + run: sudo apt-get install --upgrade docker-compose - uses: actions/checkout@v3 - name: setup phpipam uses: codeaffen/phpipam-action@v2 @@ -18,7 +20,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: '3.x' + python-version: '3.9' - name: setup test environment run: | make test-setup