- Notifications
You must be signed in to change notification settings - Fork29
Apache Sling Starter Application
License
apache/sling-org-apache-sling-starter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This module is part of theApache Sling project.
The starter project produces feature artifacts that can be launched using theFeature Launcher.
It isnot meant to be a production-ready setup, more as a way to facilitate experimenting and learning Sling.
SeeReleasing a new version of the Sling starter for how to create a release of this module.
NoteThis is a note "mvn clean" deletes the "launcher" work directory in the project basedirectory. It is advisable to use a work directory outside of the project directory.
Build the Sling Starter using
mvn clean install
in the current directory.
HintYou can defer stopping the instance after running the ITs with argument
-Dfeature-launcher.waitForInput=true
to do some manual checks.Start Sling backed by
- Oak SegmentStore withIf you are using Windows:
target/dependency/org.apache.sling.feature.launcher/bin/launcher -f target/slingfeature-tmp/feature-oak_tar.json
target\dependency\org.apache.sling.feature.launcher\bin\launcher.bat -f target\slingfeature-tmp\feature-oak_tar.json
- Oak MongoDB DocumentStore withIf you are using Windows:
target/dependency/org.apache.sling.feature.launcher/bin/launcher -f target/slingfeature-tmp/feature-oak_mongo.json
This expects a MongoDB server to be running, search fortarget\dependency\org.apache.sling.feature.launcher\bin\launcher.bat -f target\slingfeature-tmp\feature-oak_mongo.json
mongodb://
in the feature files for the expected URL (currentlymongodb://localhost:27017
).
- Oak SegmentStore with
Browse Sling inlocalhost:8080
The following tags are supported
Tag name | Supported platforms | Links |
---|---|---|
12 ,latest | amd64 | Dockerfile,Release notes |
11 | amd64 | Dockerfile,Release notes |
10 | amd64 | Dockerfile,Release notes |
9 | amd64 | Dockerfile,Release notes |
snapshot | amd64 ,arm64 | Dockerfile |
- Start Sling Docker image backed by
- Oak SegmentStore with
docker volume create sling-launcherdocker run --rm -p 8080:8080 -v sling-launcher:/opt/sling/launcher apache/sling:snapshot
- Oak MongoDB DocumentStore with
docker volume create sling-launcherdocker run --rm -p 27017:27017 mongo:4.4.6docker run --rm -p 8081:8080 -v sling-launcher:/opt/sling/launcher apache/sling:snapshot oak_mongo
- Oak SegmentStore with
Thedocker/ directory contains sample files related to container-based development.
The Sling Starter will execute two suites of tests using themaven-surefire-plugin
:
- A small set of smoke tests, embedded in the project, that verify the basic functionality of the Starter
- An extensive set of end-to-end tests that verify the overall functionality of the Starter and the bundles that are embedded into it
By default, these are both executed when building the project against an Oak SegmentNodeStore backend.
Additionally, when theci
profile is enabled the smoke tests are also executed in against an Oak DocumentNodeStore backend. For technical resons, the full end-to-end tests are not executed.
The Sling Starter Docker image is only for testing/learning purposes. For your custom applications,please configure yourFeature model andbuild your image with all dependencies and configurations built in.
Our example Docker image uses/opt/sling/bin/launch.sh
script as theentrypoint
. It supports thefollowing environment variables:
Environment variable | Description | Example |
---|---|---|
JAVA_DEBUG_PORT | Run Sling Starter in Java debug mode | 5005 |
EXTRA_JAVA_OPTS | Extra java options e.gXmx orXms . | -Xms256m -Xmx2048m |
Examplerunning Sling Starter in debug mode with custom memory settings
docker run -p 8080:8080 -p 5005:5005 -e JAVA_DEBUG_PORT=5005 -e EXTRA_JAVA_OPTS='-Xms256m -Xmx2048m' apache/sling:snapshot
This module can optionally build a Docker image. This is achieved by running a build with the-Ddocker.skip=false
argument. By default, the image is built asapache/sling:snapshot
. The tag can be overrriden using thedocker.image.tag
Maven property.
$ mvn clean package -Ddocker.skip=false -Ddocker.image.tag=local$ docker run --rm -p 8080:8080 apache/sling:local
If you wish the extend the Sling Starter but would like to keep various application-level features out, you canstart with thenosample_base
aggregate, which contains:
- all the base features
- Oak base features, without the NodeStore setup
- No applications ( Composum, Slingshot, etc )
For instance, launching an empty Sling Starter with segment persistence can be achieved by running
target/dependency/org.apache.sling.feature.launcher/bin/launcher -f target/slingfeature-tmp/feature-nosample_base.json,target/slingfeature-tmp/feature-oak_persistence_sns.json
Your own feature files can be added to the feature list.
Thescripts
directory contains helper scripts that will aid with local development by simplifying the use of tools external to the Sling Starter.
About
Apache Sling Starter Application
Topics
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.