From 456fea7f5a2bbcfd3b91e48a4bd68a17df11692b Mon Sep 17 00:00:00 2001 From: Enrique Garcia Cota Date: Mon, 24 Jun 2024 19:01:45 +0200 Subject: [PATCH] fix(ci): docker-compose -> docker compose --- compose/Makefile | 8 ++++---- compose/README.md | 4 ++-- tests/01-image.test.sh | 38 +++++++++++++++++++------------------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/compose/Makefile b/compose/Makefile index b9a63983..9295a648 100644 --- a/compose/Makefile +++ b/compose/Makefile @@ -1,9 +1,9 @@ kong-postgres: - COMPOSE_PROFILES=database KONG_DATABASE=postgres docker-compose up -d + COMPOSE_PROFILES=database KONG_DATABASE=postgres docker compose up -d kong-dbless: - docker-compose up -d + docker compose up -d clean: - docker-compose kill - docker-compose rm -f + docker compose kill + docker compose rm -f diff --git a/compose/README.md b/compose/README.md index 4d7016a0..8a69f525 100644 --- a/compose/README.md +++ b/compose/README.md @@ -13,13 +13,13 @@ This Docker Compose template provisions a Kong container with a Postgres databas To run this template execute: ```shell -$ docker-compose up +$ docker compose up ``` To scale Kong (ie, to three instances) execute: ```shell -$ docker-compose scale kong=3 +$ docker compose scale kong=3 ``` Kong will be available through the `nginx-lb` instance on port `8000`, and `8001`. You can customize the template with your own environment variables or datastore configuration. diff --git a/tests/01-image.test.sh b/tests/01-image.test.sh index d67009b5..423ff3b2 100755 --- a/tests/01-image.test.sh +++ b/tests/01-image.test.sh @@ -6,7 +6,7 @@ function run_test { if [[ -f Dockerfile.$BASE ]]; then docker run -i --rm -v $PWD/hadolint.yaml:/.config/hadolint.yaml hadolint/hadolint:2.7.0 < Dockerfile.$BASE fi - + if [[ -f $BASE/Dockerfile ]]; then docker run -i --rm -v $PWD/hadolint.yaml:/.config/hadolint.yaml hadolint/hadolint:2.7.0 < $BASE/Dockerfile fi @@ -23,11 +23,11 @@ function run_test { if [[ -f Dockerfile.$BASE ]]; then version_given="$(grep 'ARG KONG_VERSION' Dockerfile.$BASE | awk -F "=" '{print $2}')" fi - + if [[ -f $BASE/Dockerfile ]]; then version_given="$(grep 'ARG KONG_VERSION' $BASE/Dockerfile | awk -F "=" '{print $2}')" fi - + version_built="$(docker run -i --rm kong-$BASE kong version | tr -d '[:space:]')" if [[ "$version_given" != "$version_built" ]]; then @@ -40,24 +40,24 @@ function run_test { fi ttest "Dbless Test" - + pushd compose - docker-compose up -d + docker compose up -d until docker ps -f health=healthy | grep -q ${KONG_DOCKER_TAG}; do - docker-compose up -d + docker compose up -d docker ps sleep 15 done - + curl -I localhost:8001 | grep -E '(openresty|kong)' if [ $? -eq 0 ]; then tsuccess else tfailure fi - - docker-compose kill - docker-compose rm -f + + docker compose kill + docker compose rm -f sleep 5 docker volume prune -f popd @@ -67,19 +67,19 @@ function run_test { export COMPOSE_PROFILES=database export KONG_DATABASE=postgres pushd compose - curl -fsSL https://raw.githubusercontent.com/Kong/docker-kong/1.5.0/swarm/docker-compose.yml | KONG_DOCKER_TAG=kong:1.5.0 docker-compose -p kong -f - up -d + curl -fsSL https://raw.githubusercontent.com/Kong/docker-kong/1.5.0/swarm/docker-compose.yml | KONG_DOCKER_TAG=kong:1.5.0 docker compose -p kong -f - up -d until docker ps -f health=healthy | grep -q kong:1.5.0; do - curl -fsSL https://raw.githubusercontent.com/Kong/docker-kong/1.5.0/swarm/docker-compose.yml | docker-compose -p kong -f - ps + curl -fsSL https://raw.githubusercontent.com/Kong/docker-kong/1.5.0/swarm/docker-compose.yml | docker compose -p kong -f - ps docker ps sleep 15 - curl -fsSL https://raw.githubusercontent.com/Kong/docker-kong/1.5.0/swarm/docker-compose.yml | KONG_DOCKER_TAG=kong:1.5.0 docker-compose -p kong -f - up -d + curl -fsSL https://raw.githubusercontent.com/Kong/docker-kong/1.5.0/swarm/docker-compose.yml | KONG_DOCKER_TAG=kong:1.5.0 docker compose -p kong -f - up -d done curl -I localhost:8001 | grep 'Server: openresty' sed -i -e 's/127.0.0.1://g' docker-compose.yml - - KONG_DOCKER_TAG=${KONG_DOCKER_TAG} docker-compose -p kong up -d + + KONG_DOCKER_TAG=${KONG_DOCKER_TAG} docker compose -p kong up -d until docker ps -f health=healthy | grep -q ${KONG_DOCKER_TAG}; do - docker-compose -p kong ps + docker compose -p kong ps docker ps sleep 15 done @@ -90,11 +90,11 @@ function run_test { else tfailure fi - + echo "cleanup" - docker-compose -p kong kill - docker-compose -p kong rm -f + docker compose -p kong kill + docker compose -p kong rm -f sleep 5 docker volume prune -f docker system prune -y