From 61a79a1295617ede797ef1924c41a965bba0618e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Maciusiak?= <158472457+pmacius@users.noreply.github.com> Date: Thu, 24 Oct 2024 16:31:40 +0200 Subject: [PATCH] OPSEXP-2909 Remove checkout step from verify-compose and enable specifying path to postman tests (#787) Co-authored-by: Giovanni Toraldo <71768+gionn@users.noreply.github.com> --- .../dbp-charts/verify-compose/action.yml | 14 ++++++--- .../verify-compose/docker_compose.sh | 29 +++---------------- version.txt | 2 +- 3 files changed, 15 insertions(+), 30 deletions(-) diff --git a/.github/actions/dbp-charts/verify-compose/action.yml b/.github/actions/dbp-charts/verify-compose/action.yml index b0355cfb1..6e567d9e2 100644 --- a/.github/actions/dbp-charts/verify-compose/action.yml +++ b/.github/actions/dbp-charts/verify-compose/action.yml @@ -9,6 +9,14 @@ inputs: description: "run docker-compose pull before tests" required: false default: "true" + postman_path: + description: "path to postman collection" + required: false + default: "test/postman/docker-compose" + postman_json: + description: "postman collection json file" + required: false + default: "acs-test-docker-compose-collection.json" docker_username: description: "username for Docker Hub" required: false @@ -25,10 +33,6 @@ inputs: runs: using: composite steps: - - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - with: - fetch-depth: 0 - if: ${{ inputs.quay_username != '' && inputs.quay_password != '' }} name: Login to Quay.io uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 @@ -48,3 +52,5 @@ runs: env: COMPOSE_FILE_PATH: ${{ inputs.compose_file_path }} COMPOSE_PULL: ${{ inputs.compose_pull }} + POSTMAN_PATH: ${{ inputs.postman_path }} + POSTMAN_JSON: ${{ inputs.postman_json }} diff --git a/.github/actions/dbp-charts/verify-compose/docker_compose.sh b/.github/actions/dbp-charts/verify-compose/docker_compose.sh index a709eb37d..e012a759e 100755 --- a/.github/actions/dbp-charts/verify-compose/docker_compose.sh +++ b/.github/actions/dbp-charts/verify-compose/docker_compose.sh @@ -1,36 +1,15 @@ #!/bin/bash -e -COMPOSE_FILE=$(basename $COMPOSE_FILE_PATH) -COMPOSE_PATH=$(dirname $COMPOSE_FILE_PATH) COMPOSE_BIN="docker compose" -alf_port=8080 -dump_all_compose_logs() { - echo "Dumping logs for all containers" - $COMPOSE_BIN -f "${COMPOSE_FILE}" logs --no-color - exit 1 -} - -cd "$COMPOSE_PATH" || { - echo "Error: docker compose dir not found" - exit 1 -} -docker info -$COMPOSE_BIN version -$COMPOSE_BIN -f "${COMPOSE_FILE}" config echo "Starting Alfresco in docker compose" -$COMPOSE_BIN -f "${COMPOSE_FILE}" ps +$COMPOSE_BIN -f "${COMPOSE_FILE_PATH}" ps if [ "$COMPOSE_PULL" = "true" ]; then - $COMPOSE_BIN -f "${COMPOSE_FILE}" pull --quiet + $COMPOSE_BIN -f "${COMPOSE_FILE_PATH}" pull --quiet fi export COMPOSE_HTTP_TIMEOUT=120 -$COMPOSE_BIN -f "${COMPOSE_FILE}" up -d --quiet-pull --wait +$COMPOSE_BIN -f "${COMPOSE_FILE_PATH}" up -d --quiet-pull --wait echo "All services are up and running... starting postman tests" -cd .. -docker run -a STDOUT --volume "${PWD}"/test/postman/docker-compose:/etc/newman --network host postman/newman:5.3 run "acs-test-docker-compose-collection.json" --global-var "protocol=http" --global-var "url=localhost:8080" - -retVal=$? - -[ "${retVal}" -eq 0 ] && echo "Postman tests were successful" || dump_all_compose_logs +docker run -a STDOUT --volume "$(realpath "${POSTMAN_PATH}"):/etc/newman" --network host postman/newman:5.3 run "${POSTMAN_JSON}" --global-var "protocol=http" --global-var "url=localhost:8080" diff --git a/version.txt b/version.txt index 5f4f91fb4..74cccb327 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v8.0.0 +v8.1.0