Liking cljdoc? Tell your friends :D

Using Wedge in Release Environments

This guide will explain the various features Wedge provides for use in a release environment. A release is defined as "non-dev", so staging, production, etc.

Wedge provides a useful main, io.dominic.wedge.main, for running your system in a release environment. This main is inspired by Clojure’s own clojure.main, and also the -X flag to clj.

For most cases, it’s sufficient to just run clojure.main -m io.dominic.wedge.main to start your system.

The primary function of the main is to start your system for you. This is the default behavior of the main, and just running it will do that. If you’d like to specify some options to the system startup, this is where the -X similarities kick in. For example, to specify a profile when using an Aero-based system, you can run io.dominic.wedge.main :profile :staging. See your systems documentation for a reference of what keys it understands.

If you pass -r to the main, it will start a REPL. This is a useful technique for debugging in release environments, e.g. to test database connections.

Like io.dominic.wedge.user if the SLF4J Bridge is on the classpath, then Wedge will automatically load it for you as part of the startup process.

Execution pre-start

If you need to run something prior to the main, for example to hook in Sentry, you can do so by creating a simple wrapper:

(ns my.cool.main
  (:require [io.dominic.wedge.main :as main])
  (:import [io.sentry.Sentry]))

(Sentry/init)

(def -main main/-main)

Can you improve this documentation?Edit on sourcehut

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close