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

[aem-sdk] get rid of troublesome aliases #7

Merged
merged 2 commits into from
Aug 7, 2024
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
5 changes: 0 additions & 5 deletions src/aem-sdk/bin/_globals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
3 changes: 0 additions & 3 deletions src/aem-sdk/bin/aem-sdk-setup-dispatcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}'"
9 changes: 0 additions & 9 deletions src/aem-sdk/bin/aem-sdk-setup-service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
14 changes: 10 additions & 4 deletions src/aem-sdk/bin/start-aem
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
2 changes: 1 addition & 1 deletion src/aem-sdk/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
6 changes: 3 additions & 3 deletions test/aem-sdk/defaults-with-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions test/aem-sdk/options-with-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading