This project provides a skeleton for a custom Trellis application. For a full, working example, please examine the trellis-rosid-app directory in trellis-ldp/trellis-rosid.
You will need to add a persistence layer to make this code work. To do that, add your
code to the TrellisApplication class inside the run method. It will be obvious.
From there, you may wish to make further modifications to that method or to the
TrellisConfiguration class.
Unpack a zip or tar distribution. In that directory, modify ./etc/config.yml to match the
desired values for your system.
To run trellis directly from within a console, issue this command:
$ ./bin/trellis-app server ./etc/config.ymlTo install Trellis as a systemd service on linux,
follow the steps below. systemd is used by linux distributions such as CentOS/RHEL 7+ and Ubuntu 15+.
-
Move the unpacked Trellis directory to a location such as
/opt/trellis. If you choose a different location, please update the./etc/trellis.servicescript. -
Edit the
./etc/environmentfile as desired (optional). -
Edit the
./etc/config.ymlfile as desired (optional). -
Create a trellis user:
$ sudo useradd -r trellis -s /sbin/nologin- Create data directories. A different location can be used, but then please update
the
./etc/config.ymlfile.
$ sudo mkdir /var/lib/trellis
$ sudo chown trellis.trellis /var/lib/trellis- Install the systemd file:
$ sudo ln -s /opt/trellis/etc/trellis.service /etc/systemd/system/trellis.service- Reload systemd to see the changes
$ sudo systemctl daemon-reload- Start the trellis service
$ sudo systemctl start trellisTo check that trellis is running, check the URL: http://localhost:8080
Application health checks are available at http://localhost:8081/healthcheck
- Run
./gradlew clean installto build the application or download one of the releases. - Unpack the appropriate distribution in
./build/distributions - Start the application according to the steps above
The web application wrapper (Dropwizard.io) makes many configuration options available. Any of the configuration options defined by Dropwizard can be part of your application's configuration file.
