From 76e1a7049ed227eb5576af8d0df37c7bc9de62cf Mon Sep 17 00:00:00 2001 From: Juan Ayala Date: Wed, 7 Aug 2024 19:59:26 +0000 Subject: [PATCH 1/2] Get rid of troublesome aliaes --- src/aem-sdk/bin/_globals.sh | 5 ----- src/aem-sdk/bin/aem-sdk-setup-dispatcher.sh | 3 --- src/aem-sdk/bin/aem-sdk-setup-service.sh | 9 --------- src/aem-sdk/bin/start-aem | 14 ++++++++++---- test/aem-sdk/defaults-with-sdk.sh | 6 +++--- test/aem-sdk/options-with-sdk.sh | 6 +++--- 6 files changed, 16 insertions(+), 27 deletions(-) diff --git a/src/aem-sdk/bin/_globals.sh b/src/aem-sdk/bin/_globals.sh index 671e5ee..816c0b5 100644 --- a/src/aem-sdk/bin/_globals.sh +++ b/src/aem-sdk/bin/_globals.sh @@ -38,8 +38,3 @@ function get_aem_sdk_zip() echo "${sdks_dir}/aem-sdk-${AEM_SDK_VERSION}.zip" fi } - -function add_line_to_shell_rc() -{ - echo "${1}" >> "${HOME}/.$(basename ${SHELL})rc" -} diff --git a/src/aem-sdk/bin/aem-sdk-setup-dispatcher.sh b/src/aem-sdk/bin/aem-sdk-setup-dispatcher.sh index edcb0b5..21ebd23 100644 --- a/src/aem-sdk/bin/aem-sdk-setup-dispatcher.sh +++ b/src/aem-sdk/bin/aem-sdk-setup-dispatcher.sh @@ -19,6 +19,3 @@ cd ${cwd} # rename directory sudo find ${AEM_SDK_FEATURE_DIR}/dispatcher-sdk-* -maxdepth 0 -type d -execdir mv {} dispatcher \; - -# alias to start dispatcher -add_line_to_shell_rc "alias start-dispatcher='docker_run.sh src host.docker.internal:${AEM_SDK_PUBLISH_PORT} ${AEM_SDK_DISPATCHER_PORT}'" \ No newline at end of file diff --git a/src/aem-sdk/bin/aem-sdk-setup-service.sh b/src/aem-sdk/bin/aem-sdk-setup-service.sh index a11faf7..784dc22 100644 --- a/src/aem-sdk/bin/aem-sdk-setup-service.sh +++ b/src/aem-sdk/bin/aem-sdk-setup-service.sh @@ -16,12 +16,3 @@ sudo find ${runmodedir}/aem-sdk-quickstart-*.jar -maxdepth 0 -type f -execdir mv # make user owner of crx-quickstart (it is a volume mount) sudo chown ${USER} "${runmodedir}/crx-quickstart" - -port=$(get_runmode_port ${runmode}) -jvm_opts="-agentlib:\"jdwp=transport=dt_socket,address=*:3${port},server=y,suspend=n\"" -cq_opts="-nofork -nobrowser -nointeractive" - -# alias to start the instance -add_line_to_shell_rc "alias start-${runmode}='cd ${runmodedir} && java ${jvm_opts} -jar ${jar_file} ${cq_opts}'" -# alias to tail the error.log -add_line_to_shell_rc "alias tail-${runmode}='tail -f ${runmodedir}/crx-quickstart/logs/error.log'" diff --git a/src/aem-sdk/bin/start-aem b/src/aem-sdk/bin/start-aem index 2b6743f..649a6d2 100644 --- a/src/aem-sdk/bin/start-aem +++ b/src/aem-sdk/bin/start-aem @@ -19,18 +19,24 @@ source "$(dirname $0)/_globals.sh" if [[ "${service}" == "dispatcher" ]]; then toolsdir="${AEM_SDK_FEATURE_DIR}/dispatcher" - # setup if dispatcher directory is missing if [[ ! -d ${toolsdir} ]]; then + # install it $(dirname $0)/aem-sdk-setup-dispatcher.sh fi + # run it + docker_run.sh src host.docker.internal:${AEM_SDK_PUBLISH_PORT} ${AEM_SDK_DISPATCHER_PORT} elif [[ "${service}" == "author" || "${service}" == "publish" ]]; then jar="${AEM_SDK_FEATURE_DIR}/${service}/$(get_runmode_jar ${service})" - # setup aem if jar file is missing if [[ ! -f ${jar} ]]; then + # install it $(dirname $0)/aem-sdk-setup-service.sh ${service} fi + # run it + port=$(get_runmode_port ${service}) + jvm_opts="-agentlib:jdwp=transport=dt_socket,address=*:3${port},server=y,suspend=n" + cq_opts="-nofork -nobrowser -nointeractive" + cd "$(dirname ${jar})" + java ${jvm_opts} -jar ${jar} ${cq_opts} fi - -bash -ci "start-${service}" diff --git a/test/aem-sdk/defaults-with-sdk.sh b/test/aem-sdk/defaults-with-sdk.sh index a4d75cd..36543c3 100644 --- a/test/aem-sdk/defaults-with-sdk.sh +++ b/test/aem-sdk/defaults-with-sdk.sh @@ -21,10 +21,10 @@ check "start-aem is +x" \ stat -c '%A' $(which start-aem) | grep 'x.*x.*x' # Check that author/publish/dispatcher installs and starts check "can install & run author" \ - bash -ci "start-aem author | grep 'hello, world'" + bash -c "start-aem author | grep 'hello, world'" check "can install & run publish" \ - bash -ci "start-aem publish | grep 'hello, world'" + bash -c "start-aem publish | grep 'hello, world'" check "can install & run dispatcher" \ - bash -ci "start-aem dispatcher | grep 'All your base are belong to us'" + bash -c "start-aem dispatcher | grep 'All your base are belong to us'" reportResults diff --git a/test/aem-sdk/options-with-sdk.sh b/test/aem-sdk/options-with-sdk.sh index 1f46af3..e815748 100644 --- a/test/aem-sdk/options-with-sdk.sh +++ b/test/aem-sdk/options-with-sdk.sh @@ -21,10 +21,10 @@ check "start-aem is +x" \ stat -c '%A' $(which start-aem) | grep 'x.*x.*x' # Check that author/publish/dispatcher installs and starts check "can install & run author" \ - bash -ci "start-aem author | grep 'hello, world'" + bash -c "start-aem author | grep 'hello, world'" check "can install & run publish" \ - bash -ci "start-aem publish | grep 'hello, world'" + bash -c "start-aem publish | grep 'hello, world'" check "can install & run dispatcher" \ - bash -ci "start-aem dispatcher | grep 'All your base are belong to us'" + bash -c "start-aem dispatcher | grep 'All your base are belong to us'" reportResults From d8b54dac57501eea52fbba14d8b72d554c732223 Mon Sep 17 00:00:00 2001 From: Juan Ayala Date: Wed, 7 Aug 2024 20:00:56 +0000 Subject: [PATCH 2/2] Bump patch version --- src/aem-sdk/devcontainer-feature.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aem-sdk/devcontainer-feature.json b/src/aem-sdk/devcontainer-feature.json index 06193e8..d3dfe41 100644 --- a/src/aem-sdk/devcontainer-feature.json +++ b/src/aem-sdk/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "aem-sdk", - "version": "1.1.0", + "version": "1.1.1", "name": "Adobe Experience Manager SDK", "description": "Setup author and publish services. And the dispatcher tools. Requires the AEM as a Cloud Service SDK.", "options": {