Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPSEXP-2909 Remove checkout step from verify-compose and enable specifying path to postman tests #787

Merged
merged 12 commits into from
Oct 24, 2024
14 changes: 10 additions & 4 deletions .github/actions/dbp-charts/verify-compose/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -25,10 +33,6 @@ inputs:
runs:
using: composite
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
fetch-depth: 0
pmacius marked this conversation as resolved.
Show resolved Hide resolved
- if: ${{ inputs.quay_username != '' && inputs.quay_password != '' }}
name: Login to Quay.io
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
Expand All @@ -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 }}
29 changes: 4 additions & 25 deletions .github/actions/dbp-charts/verify-compose/docker_compose.sh
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v8.0.0
v8.1.0
Loading