Pantheon 2 is a modular documentation management and publication system based on asciidoc and built on top of Apache sling.
Podman Buildah Java
(All commands from here on will be assumed to be ran from the project's root directory)
./mvnw clean install
./mvnw test
The best way to run Pantheon is to install podman.
First, create a pod:
podman pod create --name pantheon -p 8080 -p 5005
This will create a pantheon
pod with ports 8080 (for web access) and 5005 (for
remote Java debugging) open.
Run a mongo database container in the pod.
podman run --pod pantheon --name slingmongo -d mongo
Build the pantheon docker image
buildah bud --layers -f container/Dockerfile -t pantheon-app .
Run the sling container pod in the pod.
podman run --pod pantheon -d -e SLING_OPTS='-Dsling.run.modes=oak_mongo -Doak.mongo.uri=mongodb://localhost:27017' --name pantheon-app pantheon-app
The Sling launchpad can be accessed at http://localhost:8080
and you can log in to
it using the admin/admin
username password combo.
This is useful when developing the application. To deploy the code live to a running application, all you have to do is
./mvnw clean package sling:install -pl pantheon-bundle
This will install the code in this project on the running Sling instance, where it can be previewed and modified.
Head to http://localhost:8080/pantheon for the application's entry point.
For sling's management UI, you can head to http://localhost:8080/starter/index.html
You can stop and start the pod as necessary with podman's pod command:
podman pod stop pantheon
podman pod start pantheon
Run the container without Mongo, but this will result in the data being destroyed with the container.
podman run --rm -p 8080:8080 YOURTAG
Open a terminal inside the container and debug
get the container process
podman ps
podman exec -it PROCESS bash
If making modifications that are entirely contained within the frontend, it is not necessary to use maven to rebuild and redeploy the package on every change.
These instructions provide an imperfect-but-workable shortcut that can accelerate development.
cd pantheon/frontend
yarn start
chromium-browser --disable-web-security --user-data-dir=/home/user/anywhere/chromeDev/ &
This works because there is code in app.tsx that preempts all fetch() calls and checks if the app is being served from localhost. If so, it modifies the request to point to localhost:8080 specifically, rather than localhost:9000 which is where webpack-dev-server serves the frontend code from.
It might be possible to improve this technique. Suggestions are welcome.