From 40b2c56be31218c53536e5d73d81228954da467b Mon Sep 17 00:00:00 2001 From: Nick Satterly Date: Sat, 23 Dec 2023 23:28:14 +0100 Subject: [PATCH] Update tests to use new build args --- .github/workflows/tests.yml | 30 +++++++++++++++++--------- docker-compose.yml | 1 + tests/docker-compose.test.mongodb.yml | 5 +++-- tests/docker-compose.test.postgres.yml | 5 +++-- 4 files changed, 27 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e7e99de6..1317938e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,11 +23,16 @@ jobs: - < Dockerfile - name: Run tests id: smoketest - run: | - docker-compose -f tests/docker-compose.test.postgres.yml build \ - --build-arg VCS_REF=${{ github.sha }} \ - --build-arg VERSION=$(cat VERSION) - docker-compose -f tests/docker-compose.test.postgres.yml up --exit-code-from tester + run: >- + BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + RELEASE=$(cat VERSION) + VERSION=${{ github.sha }} + docker-compose + -f tests/docker-compose.test.mongodb.yml + up + --build + --quiet-pull + --exit-code-from tester - uses: act10ns/slack@v2 with: status: ${{ job.status }} @@ -48,11 +53,16 @@ jobs: - < Dockerfile - name: Run tests id: smoketest - run: | - docker-compose -f tests/docker-compose.test.mongodb.yml build \ - --build-arg VCS_REF=${{ github.sha }} \ - --build-arg VERSION=$(cat VERSION) - docker-compose -f tests/docker-compose.test.mongodb.yml up --exit-code-from tester + run: >- + BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + RELEASE=$(cat VERSION) + VERSION=${{ github.sha }} + docker-compose + -f tests/docker-compose.test.mongodb.yml + up + --build + --quiet-pull + --exit-code-from tester - uses: act10ns/slack@v2 with: status: ${{ job.status }} diff --git a/docker-compose.yml b/docker-compose.yml index e5542c09..766ab5dc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,5 @@ version: '3.1' + services: web: image: alerta/alerta-web diff --git a/tests/docker-compose.test.mongodb.yml b/tests/docker-compose.test.mongodb.yml index a198b752..d9ca5d62 100644 --- a/tests/docker-compose.test.mongodb.yml +++ b/tests/docker-compose.test.mongodb.yml @@ -1,11 +1,12 @@ -version: '3' +version: '3.1' services: sut: build: context: .. args: - VCS_REF: ${VCS_REF} + BUILD_DATE: ${BUILD_DATE} + RELEASE: ${RELEASE} VERSION: ${VERSION} # image: alerta/alerta-web ports: diff --git a/tests/docker-compose.test.postgres.yml b/tests/docker-compose.test.postgres.yml index 251e0433..e58e0775 100644 --- a/tests/docker-compose.test.postgres.yml +++ b/tests/docker-compose.test.postgres.yml @@ -1,11 +1,12 @@ -version: '3' +version: '3.1' services: sut: build: context: .. args: - VCS_REF: ${VCS_REF} + BUILD_DATE: ${BUILD_DATE} + RELEASE: ${RELEASE} VERSION: ${VERSION} # image: alerta/alerta-web ports: