You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2019/04/23 14:54:18 UTC

[sling-org-apache-sling-committer-cli] 09/39: SLING-8311 - Investigate creating a Sling CLI tool for development task automation

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch feature/SLING-8337
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-committer-cli.git

commit c2beebd3b7902a4f6c8e1cdbff13fc488fd4e268
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed Mar 20 10:14:33 2019 +0100

    SLING-8311 - Investigate creating a Sling CLI tool for development task automation
    
    Enable class data sharing. This yields a small (~120ms) startup time improvement
    in local testing.
---
 Dockerfile                             | 6 +++++-
 src/main/resources/scripts/launcher.sh | 3 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 1338fcb..c29cd1e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -12,6 +12,10 @@
 
 FROM openjdk:8-jre-alpine
 MAINTAINER dev@sling.apache.org
+
+# Generate class data sharing
+RUN java -Xshare:dump
+
 # escaping required to properly handle arguments with spaces
 ENTRYPOINT ["/usr/share/sling-cli/bin/launcher.sh"]
 
@@ -27,4 +31,4 @@ ADD target/classes/conf /usr/share/sling-cli/conf
 ADD target/artifacts /usr/share/sling-cli/artifacts
 # Add the service itself
 ARG FEATURE_FILE
-ADD ${FEATURE_FILE} /usr/share/sling-cli/sling-cli.feature
\ No newline at end of file
+ADD ${FEATURE_FILE} /usr/share/sling-cli/sling-cli.feature
diff --git a/src/main/resources/scripts/launcher.sh b/src/main/resources/scripts/launcher.sh
index 6f0bcfb..7b306ba 100755
--- a/src/main/resources/scripts/launcher.sh
+++ b/src/main/resources/scripts/launcher.sh
@@ -19,6 +19,7 @@ ARGS_PROP="exec.args=$@"
 
 # Use exec to become pid 1, see https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
 exec /usr/bin/java \
+     -Xshare:on \
 	 -Dorg.slf4j.simpleLogger.logFile=/dev/null \
 	 -Dlogback.configurationFile=file:/usr/share/sling-cli/conf/logback-default.xml \
 	 -jar /usr/share/sling-cli/launcher/org.apache.sling.feature.launcher.jar \
@@ -26,4 +27,4 @@ exec /usr/bin/java \
 	 -c /usr/share/sling-cli/artifacts \
 	 -D "$ARGS_PROP" \
 	 -V "asf.username=${ASF_USERNAME}" \
-	 -V "asf.password=${ASF_PASSWORD}"
\ No newline at end of file
+	 -V "asf.password=${ASF_PASSWORD}"