From bccb0be15d6e4afd7eb2a9b5d16a9fb621ce1f4b Mon Sep 17 00:00:00 2001 From: Shubham Date: Wed, 20 Nov 2024 13:19:16 +0530 Subject: [PATCH 1/2] chore: install docker-compose --- .github/workflows/test-and-deploy.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index 626bb5a7..a8d59bb0 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -31,6 +31,11 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_AUTH_TOKEN }} + - name: Install Docker Compose + run: | + sudo apt-get update + sudo apt-get install -y docker-compose + - name: Run Unit Tests run: make test-docker version=${{ matrix.php }} From 1724e0527c2f7b8ca1dcecd761bcf2f99b8970bd Mon Sep 17 00:00:00 2001 From: Shubham Tiwari Date: Wed, 20 Nov 2024 13:44:54 +0530 Subject: [PATCH 2/2] chore: use docker compose v2 --- .gitignore | 2 +- Makefile | 1 - prism.sh | 15 +++++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 prism.sh diff --git a/.gitignore b/.gitignore index 740353cf..fac9958c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ test.php .idea/ *.code-workspace .vscode -prism* +prism/ temp.php TODO.txt sendgrid-php.zip diff --git a/Makefile b/Makefile index 490d4fa8..6e6fc8c7 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,6 @@ test-integ: test version ?= latest test-docker: - curl -s https://raw.githubusercontent.com/sendgrid/sendgrid-oai/HEAD/prism/prism.sh -o prism.sh dependencies=lowest version=$(version) bash ./prism.sh dependencies=highest version=$(version) bash ./prism.sh diff --git a/prism.sh b/prism.sh new file mode 100644 index 00000000..b37a1bee --- /dev/null +++ b/prism.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +rm -rf prism && mkdir -p prism && cd prism +git clone --depth 1 https://github.com/sendgrid/sendgrid-oai . +cd prism + +docker compose build --parallel + +if [ -z "$command" ]; then + docker compose up --force-recreate --abort-on-container-exit --remove-orphans +else + docker compose run helper-runner "$command" + docker compose down +fi