This is an automated email from the ASF dual-hosted git repository. dklco pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git
commit 3edbcbb24923038c95bb9290c7d59a1862167ade Author: Dan Klco <[email protected]> AuthorDate: Wed Sep 30 17:28:06 2020 -0400 Updating to build the author/renderer as a part of the docker compose --- docker/cms/Dockerfile | 16 +++++++++++----- docker/cms/download-dependencies.sh | 26 ++++++++++++++++++++------ docker/cms/setup-composite.sh | 9 ++++++--- docker/docker-compose.yml | 21 +++++++++++++++++---- docker/webcache/cms.conf | 4 ++-- docker/webcache/site.conf | 8 ++++---- 6 files changed, 60 insertions(+), 24 deletions(-) diff --git a/docker/cms/Dockerfile b/docker/cms/Dockerfile index 067f067..ee53fce 100644 --- a/docker/cms/Dockerfile +++ b/docker/cms/Dockerfile @@ -14,12 +14,17 @@ # Pull base image. FROM adoptopenjdk:11-jre-openj9 -ARG FM_GROUP_ID=org.apache.sling -ARG FM_ARTIFACT_ID=org.apache.sling.cms.feature -ARG FM_VERSION=0.16.3-SNAPSHOT +ARG ADDITIONAL_FEATURE_COORDINATE= +ARG CMS_GROUP_ID=org.apache.sling +ARG CMS_ARTIFACT_ID=org.apache.sling.cms.feature +ARG CMS_VERSION=0.16.3-SNAPSHOT +ARG LAUNCHER_VERSION=1.1.6 ARG FM_SEED_CLASSIFIER=slingcms-composite-seed +ARG FM_RUNMODE_CLASSIFIER=runmode-standalone ARG FM_RUNTIME_CLASSIFIER=slingcms-composite-runtime -ENV FM_ARTIFACT_ID=${FM_ARTIFACT_ID} +ENV ADDITIONAL_FEATURE_COORDINATE=${ADDITIONAL_FEATURE_COORDINATE} +ENV CMS_ARTIFACT_ID=${CMS_ARTIFACT_ID} +ENV FM_RUNMODE_CLASSIFIER=${FM_RUNMODE_CLASSIFIER} ENV FM_RUNTIME_CLASSIFIER=${FM_RUNTIME_CLASSIFIER} # Configure directories @@ -40,4 +45,5 @@ EXPOSE 8080 # Start Sling CMS CMD exec java -jar org.apache.sling.feature.launcher.jar \ - -f ${FM_ARTIFACT_ID}-${FM_RUNTIME_CLASSIFIER}.slingosgifeature + -f *.slingosgifeature \ + -f features/*.slingosgifeature diff --git a/docker/cms/download-dependencies.sh b/docker/cms/download-dependencies.sh index 9705148..ae5ec91 100644 --- a/docker/cms/download-dependencies.sh +++ b/docker/cms/download-dependencies.sh @@ -11,24 +11,38 @@ # and limitations under the License. # -mkdir -p /opt/slingcms +mkdir -p /opt/slingcms/features cd /opt/slingcms echo "Downloading Feature Launcher..." mvn -q org.apache.maven.plugins:maven-dependency-plugin:copy \ - -Dartifact=org.apache.sling:org.apache.sling.feature.launcher:1.1.4:jar \ + -Dartifact=org.apache.sling:org.apache.sling.feature.launcher:${LAUNCHER_VERSION}:jar \ -DoutputDirectory=/opt/slingcms \ -Dmdep.stripVersion=true \ - || { echo 'Failed to download Feature Launcher' ; exit 1; } + || { echo 'Failed to download Feature Launcher' ; exit 1; } echo "Downloading Feature Models..." mvn -q org.apache.maven.plugins:maven-dependency-plugin:copy \ - -Dartifact=${FM_GROUP_ID}:${FM_ARTIFACT_ID}:${FM_VERSION}:slingosgifeature:${FM_SEED_CLASSIFIER} \ + -Dartifact=${CMS_GROUP_ID}:${CMS_ARTIFACT_ID}:${CMS_VERSION}:slingosgifeature:${FM_SEED_CLASSIFIER} \ -DoutputDirectory=/opt/slingcms/setup \ -Dmdep.stripVersion=true \ || { echo 'Failed to download composite seed' ; exit 1; } mvn -q org.apache.maven.plugins:maven-dependency-plugin:copy \ - -Dartifact=${FM_GROUP_ID}:${FM_ARTIFACT_ID}:${FM_VERSION}:slingosgifeature:${FM_RUNTIME_CLASSIFIER} \ + -Dartifact=${CMS_GROUP_ID}:${CMS_ARTIFACT_ID}:${CMS_VERSION}:slingosgifeature:${FM_RUNTIME_CLASSIFIER} \ -DoutputDirectory=/opt/slingcms \ -Dmdep.stripVersion=true \ - || { echo 'Failed to download composite runtime' ; exit 1; } \ No newline at end of file + || { echo 'Failed to download composite runtime' ; exit 1; } +mvn -q org.apache.maven.plugins:maven-dependency-plugin:copy \ + -Dartifact=${CMS_GROUP_ID}:${CMS_ARTIFACT_ID}:${CMS_VERSION}:slingosgifeature:${FM_RUNMODE_CLASSIFIER} \ + -DoutputDirectory=/opt/slingcms/features \ + -Dmdep.stripVersion=true \ + || { echo 'Failed to download author feature' ; exit 1; } + +if [[ ! -z ${ADDITIONAL_FEATURE_COORDINATE} ]]; then + echo "Downloading Additional Feature ${ADDITIONAL_FEATURE_COORDINATE}" + mvn -q org.apache.maven.plugins:maven-dependency-plugin:copy \ + -Dartifact=${ADDITIONAL_FEATURE_COORDINATE} \ + -DoutputDirectory=/opt/slingcms/features \ + -Dmdep.stripVersion=true \ + || { echo "Failed to download feature ${ADDITIONAL_FEATURE_COORDINATE}" ; exit 1; } +fi \ No newline at end of file diff --git a/docker/cms/setup-composite.sh b/docker/cms/setup-composite.sh index fec1a03..bec941d 100644 --- a/docker/cms/setup-composite.sh +++ b/docker/cms/setup-composite.sh @@ -16,14 +16,15 @@ SLING_PASSWORD="${SLING_PASSWORD:-admin}" echo "Creating composite seed..." java -jar org.apache.sling.feature.launcher.jar \ - -f /opt/slingcms/setup/${FM_ARTIFACT_ID}-${FM_SEED_CLASSIFIER}.slingosgifeature & + -f /opt/slingcms/setup/${CMS_ARTIFACT_ID}-${FM_SEED_CLASSIFIER}.slingosgifeature \ + -f /opt/slingcms/features/*.slingosgifeature & SLING_PID=$! echo "Sling PID: ${SLING_PID}" sleep 30s STARTED=1 -for i in {1..10}; do - echo "Checking to see if started with username: ${SLING_USERNAME}..." +for i in {1..20}; do + echo "[${i}/20]: Checking to see if started with username: ${SLING_USERNAME}..." STATUS=$(curl -4 -s -o /dev/null -w "%{http_code}" -u${SLING_USERNAME}:${SLING_PASSWORD} "http://localhost:8080/system/health.txt?tags=systemalive") echo "Retrieved status: ${STATUS}" if [ $STATUS -eq 200 ]; then @@ -34,6 +35,8 @@ for i in {1..10}; do done sleep 30s kill $SLING_PID +echo "Waiting for instance to stop..." +sleep 30s if [ $STARTED -eq 1 ]; then echo "Failed to seed sling repository!" diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 27856bb..cc3df4f 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -11,15 +11,28 @@ # version: '3.4' services: - cms: - build: cms + author: + build: + context: cms + args: + FM_RUNMODE_CLASSIFIER: runmode-author ports: - "8080:8080" volumes: - - sling-repository:/opt/slingcms/sling/composite/repository-global + - sling-author:/opt/slingcms/sling/composite/repository-global + renderer: + build: + context: cms + args: + FM_RUNMODE_CLASSIFIER: runmode-renderer + ports: + - "8090:8080" + volumes: + - sling-renderer:/opt/slingcms/sling/composite/repository-global webcache: build: webcache ports: - "80:80" volumes: - sling-repository: + sling-author: + sling-renderer: diff --git a/docker/webcache/cms.conf b/docker/webcache/cms.conf index 47fa459..6c9ce63 100644 --- a/docker/webcache/cms.conf +++ b/docker/webcache/cms.conf @@ -17,6 +17,6 @@ TransferLog /var/log/apache2/sling-cms-access.log ProxyPass /.well-known ! - ProxyPass / http://cms:8080/ - ProxyPassReverse / http://cms:8080/ + ProxyPass / http://author:8080/ + ProxyPassReverse / http://author:8080/ </VirtualHost> diff --git a/docker/webcache/site.conf b/docker/webcache/site.conf index 57ae148..811b3bb 100644 --- a/docker/webcache/site.conf +++ b/docker/webcache/site.conf @@ -38,10 +38,10 @@ # Configure Proxy ProxyPass /.well-known ! ProxyPass /ERROR ! - ProxyPass /static/clientlibs/reference/ http://cms:8080/static/clientlibs/reference/ connectiontimeout=10 timeout=60 retry=0 - ProxyPassReverse /static/clientlibs/reference/ http://cms:8080/static/clientlibs/reference/ - ProxyPass / http://cms:8080/content/apache/sling-apache-org/ connectiontimeout=10 timeout=60 retry=0 - ProxyPassReverse /content/apache/sling-apache-org/ http://cms:8080/content/apache/sling-apache-org/ + ProxyPass /static/clientlibs/reference/ http://renderer:8080/static/clientlibs/reference/ connectiontimeout=10 timeout=60 retry=0 + ProxyPassReverse /static/clientlibs/reference/ http://renderer:8080/static/clientlibs/reference/ + ProxyPass / http://renderer:8080/content/apache/sling-apache-org/ connectiontimeout=10 timeout=60 retry=0 + ProxyPassReverse /content/apache/sling-apache-org/ http://renderer:8080/content/apache/sling-apache-org/ # Security / Hardening AllowEncodedSlashes on
