From da08547ab1a153084dbce072f53c456817ea0be6 Mon Sep 17 00:00:00 2001 From: Thomas Draier Date: Wed, 5 Jul 2023 13:39:10 +0200 Subject: [PATCH 1/4] Script fixes, use docker profiles --- ci.build.sh | 0 env.debug.sh | 0 env.provision.sh | 0 env.run.sh | 0 package.json | 4 ++-- 5 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 ci.build.sh mode change 100644 => 100755 env.debug.sh mode change 100644 => 100755 env.provision.sh mode change 100644 => 100755 env.run.sh diff --git a/ci.build.sh b/ci.build.sh old mode 100644 new mode 100755 diff --git a/env.debug.sh b/env.debug.sh old mode 100644 new mode 100755 diff --git a/env.provision.sh b/env.provision.sh old mode 100644 new mode 100755 diff --git a/env.run.sh b/env.run.sh old mode 100644 new mode 100755 diff --git a/package.json b/package.json index 531cec7..8f89fb1 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "bin": { "ci.build": "./ci.build.sh", "ci.startup": "./ci.startup.sh", - "env.run": "./ci.startup.sh", - "env.debug": "./ci.startup.sh" + "env.run": "./env.run.sh", + "env.debug": "./env.debug.sh" }, "main": "dist/index.js", "types": "dist/index.d.ts", From 0ec7edc1686a1b068c6bb29a920f48016216b73e Mon Sep 17 00:00:00 2001 From: Thomas Draier Date: Wed, 5 Jul 2023 13:39:29 +0200 Subject: [PATCH 2/4] version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8f89fb1..5ac9dc7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@jahia/cypress", - "version": "3.14.0", + "version": "3.14.1", "scripts": { "build": "tsc", "lint": "eslint src -c .eslintrc.json --ext .ts" From 41cb8cb605b5c75940821b343b8cf185481d00e6 Mon Sep 17 00:00:00 2001 From: Thomas Draier Date: Wed, 5 Jul 2023 13:44:15 +0200 Subject: [PATCH 3/4] use profiles --- ci.startup.sh | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/ci.startup.sh b/ci.startup.sh index a286437..b5270d1 100755 --- a/ci.startup.sh +++ b/ci.startup.sh @@ -25,25 +25,15 @@ if [[ -z ${JAHIA_LICENSE} ]]; then fi fi -echo "$(date +'%d %B %Y - %k:%M') [JAHIA_CLUSTER_ENABLED] == Value: ${JAHIA_CLUSTER_ENABLED} ==" +echo "$(date +'%d %B %Y - %k:%M') == Cluster enabled: ${JAHIA_CLUSTER_ENABLED} ==" if [[ "${JAHIA_CLUSTER_ENABLED}" == "true" ]]; then - echo "$(date +'%d %B %Y - %k:%M') [JAHIA_CLUSTER_ENABLED] == Starting a cluster of one processing and two browsing ==" - if [[ $1 == "notests" ]]; then - docker-compose up -d --renew-anon-volumes mariadb jahia jahia-browsing-a jahia-browsing-b alfresco dockerldap - else - docker-compose up --renew-anon-volumes -d mariadb jahia jahia-browsing-a jahia-browsing-b alfresco dockerldap - docker ps -a - docker stats --no-stream - docker-compose up --abort-on-container-exit cypress - fi -else - echo "$(date +'%d %B %Y - %k:%M') [JAHIA_CLUSTER_ENABLED] == Starting a single processing node (no cluster) ==" - if [[ $1 == "notests" ]]; then - docker-compose up -d --renew-anon-volumes mariadb jahia alfresco dockerldap - else - docker-compose up --renew-anon-volumes -d mariadb jahia alfresco dockerldap - docker ps -a - docker stats --no-stream - docker-compose up --abort-on-container-exit cypress - fi + export CLUSTER_PROFILE="--profile cluster" +fi + +echo "$(date +'%d %B %Y - %k:%M') == Starting environment ==" +docker-compose up -d --renew-anon-volumes ${CLUSTER_PROFILE} +if [[ "$1" != "notests" ]]; then + docker ps -a + docker stats --no-stream + docker-compose up --abort-on-container-exit cypress fi From 0be5a7a4979895d72a8bb48df4c72bdc70f29e4b Mon Sep 17 00:00:00 2001 From: Thomas Draier Date: Wed, 5 Jul 2023 13:54:42 +0200 Subject: [PATCH 4/4] resolve symlinks from .bin --- ci.build.sh | 2 +- ci.startup.sh | 2 +- env.debug.sh | 2 +- env.provision.sh | 2 +- env.run.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ci.build.sh b/ci.build.sh index 8cd5d57..4b513c7 100755 --- a/ci.build.sh +++ b/ci.build.sh @@ -4,7 +4,7 @@ echo " ci.build.sh == Build test image" -BASEDIR=$(dirname "$0") +BASEDIR=$(dirname $(readlink -f $0)) source $BASEDIR/set-env.sh diff --git a/ci.startup.sh b/ci.startup.sh index b5270d1..7b544b1 100755 --- a/ci.startup.sh +++ b/ci.startup.sh @@ -3,7 +3,7 @@ # This script controls the startup of the container environment # It can be used as an alternative to having docker-compose up started by the CI environment -BASEDIR=$(dirname "$0") +BASEDIR=$(dirname $(readlink -f $0)) source $BASEDIR/set-env.sh diff --git a/env.debug.sh b/env.debug.sh index 0b06c07..df22c3b 100755 --- a/env.debug.sh +++ b/env.debug.sh @@ -2,7 +2,7 @@ # This script can be used to warmup the environment and execute the tests # It is used by the docker image at startup -BASEDIR=$(dirname "$0") +BASEDIR=$(dirname $(readlink -f $0)) bash $BASEDIR/env.provision.sh diff --git a/env.provision.sh b/env.provision.sh index 986452f..d8ca757 100755 --- a/env.provision.sh +++ b/env.provision.sh @@ -2,7 +2,7 @@ # This script can be used to warmup the environment and execute the tests # It is used by the docker image at startup -BASEDIR=$(dirname "$0") +BASEDIR=$(dirname $(readlink -f $0)) source $BASEDIR/set-env.sh diff --git a/env.run.sh b/env.run.sh index f82899e..95b376d 100755 --- a/env.run.sh +++ b/env.run.sh @@ -2,7 +2,7 @@ # This script can be used to warmup the environment and execute the tests # It is used by the docker image at startup -BASEDIR=$(dirname "$0") +BASEDIR=$(dirname $(readlink -f $0)) bash $BASEDIR/env.provision.sh