Skip to content

Update scripts to be flexible with regard to commercial vs oss editio… #70

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

Merged
merged 1 commit into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions bin/docker-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
set -e

declare VERSION=${COHERENCE_VERSION:=22.06.5}
declare TYPE=${COHERENCE_TYPE:=coherence-ce}
declare REGISTRY=${DOCKER_REGISTRY:=ghcr.io/oracle}

echo ${VERSION}
echo ${TYPE}

function coh_up() {
echo "Starting test containers ..."
COHERENCE_VERSION="${VERSION}" docker-compose -f etc/docker-compose-2-members.yaml up --force-recreate --renew-anon-volumes -d
DOCKER_REGISTRY="${REGISTRY}" COHERENCE_VERSION="${VERSION}" COHERENCE_TYPE="${TYPE}" docker-compose -f etc/docker-compose-2-members.yaml up --force-recreate --renew-anon-volumes -d
SECONDS=0
echo "Waiting for Coherence to be healthy (within 60s) ..."
while [ ${SECONDS} -le 60 ]; do
Expand All @@ -24,14 +29,14 @@ function coh_up() {
done
node_version=$(node -v)
filename="logs-startup-${VERSION}-${node_version}.txt"
COHERENCE_VERSION="${VERSION}" docker-compose -f etc/docker-compose-2-members.yaml logs --no-color > "${filename}"
DOCKER_REGISTRY="${REGISTRY}" COHERENCE_VERSION="${VERSION}" COHERENCE_TYPE="${TYPE}" docker-compose -f etc/docker-compose-2-members.yaml logs --no-color > "${filename}"
echo "Coherence failed to become healthy. See ${filename} for details."
coh_down
exit 1
}

function coh_down() {
COHERENCE_VERSION="${VERSION}" docker-compose -f etc/docker-compose-2-members.yaml down -v
DOCKER_REGISTRY="${REGISTRY}" COHERENCE_VERSION="${VERSION}" COHERENCE_TYPE="${TYPE}" docker-compose -f etc/docker-compose-2-members.yaml down -v
}

while getopts "ud" OPTION; do
Expand Down
4 changes: 3 additions & 1 deletion bin/test-cycle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ mkdir -p "${PWD}"/etc/cert
chmod 777 "${PWD}"/etc/cert

declare VERSION=${COHERENCE_VERSION:=22.06.2}
declare TYPE=${COHERENCE_TYPE:=coherence-ce}
declare REGISTRY=${DOCKER_REGISTRY:=ghcr.io/oracle}
declare LABEL=clear

function run_secure() {
Expand Down Expand Up @@ -40,7 +42,7 @@ function run_tests() {

function dump_logs() {
node_version=$(node -v)
COHERENCE_VERSION=${VERSION} docker-compose -f etc/docker-compose-2-members.yaml logs --no-color > logs-"${1}"-test-"${VERSION}"-"${node_version}".txt
DOCKER_REGISTRY="${REGISTRY}" COHERENCE_VERSION="${VERSION}" COHERENCE_TYPE="${TYPE}" docker-compose -f etc/docker-compose-2-members.yaml logs --no-color > logs-"${1}"-test-"${VERSION}"-"${node_version}".txt
}

function cleanup() {
Expand Down
4 changes: 2 additions & 2 deletions etc/docker-compose-2-members.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
coherence:
aliases:
- server1
image: ghcr.io/oracle/coherence-ce:${COHERENCE_VERSION}
image: ${DOCKER_REGISTRY}/${COHERENCE_TYPE}:${COHERENCE_VERSION}
environment:
- COHERENCE_WKA=server1
ports:
Expand All @@ -29,7 +29,7 @@ services:
coherence:
aliases:
- server2
image: ghcr.io/oracle/coherence-ce:${COHERENCE_VERSION}
image: ${DOCKER_REGISTRY}/${COHERENCE_TYPE}:${COHERENCE_VERSION}
environment:
- COHERENCE_WKA=server1
ports:
Expand Down