Manage a fleet of Confluence instances with ease. For development and testing purposes.
- Each Confluence instance is initialized together with a Postgres database
- Run multiple Confluence instances in parallel, fleet dynamically assigns ports to each instance
- Confluence instances can be exported and imported
- Two layered settings: Define global settings and optionally overwrite them on an instance level
- fleet can be used programmatically
- Define one instance as master. The master instance will listen on port 8090
- NodeJS >= 8
- Docker
npm install @xat/fleet --global
fleet add <id> [--version=<confluence-version>] [--start] [--open] [--<setting>=<value>]
- id The id of the instance
- --version=<confluence-version> The Confluence version. Defaults to the latest version
- --start Directly start the instance after it was created
- --open Open Confluence in the browser after it was started
- --<setting>=<value> See available settings
fleet start <id> [--open]
- id The id of the instance
- --open Open Confluence in the browser after it was started
fleet open <id>
- id The id of the instance
fleet stop <id>
- id The id of the instance
fleet list
fleet
fleet info <id>
- id The id of the instance
fleet clone <id> <newId> [--version=<confluence-version>] [--<setting>=<value>]
- id The id of the instance
- newId The id of the duplicate
- --version=<confluence-version> The Confluence version of the duplicate
- --<setting>=<value> See available settings
Rebuilding an instance means that its Docker containers will be re-recreated.
fleet rebuild <id>
- id The id of the instance
fleet rebuild-all
One instance in the fleet can be the master instance. The master Confluence instance will listen on port 8090.
fleet master <id>
- id The id of the instance
Removing an instance will delete its Docker containers as well as the Confluence home directory and the database.
fleet remove <id>
- id The id of the instance
Settings can be defined globally and and on an instance level. Settings on an instance level are prioritized over global settings. This means that you can define common settings globally and then overwrite them on an instance level.
fleet global-settings [--<setting>=<value>]
- --<setting>=<value> See available settings
After changing the settings of an instance you will likely need to rebuild it.
fleet settings <id> [--<setting>=<value>]
- id The id of the instance
- --<setting>=<value> See available settings
The export will include the Confluence home directory and the database.
fleet export <id> > <filename.tar>
- id The id of the instance
cat <filename.tar> | fleet import <id> [--version=<confluence-version>] [--start] [--open] [--<setting>=<value>]
- id The id of the instance
- --version=<confluence-version> The Confluence version of the imported instance
- --start Directly start the instance after it was created
- --open Open Confluence in the browser after it was started
- --<setting>=<value> See available settings
These are the available settings:
Additional JVM arguments for Confluence
Default: ''
The minimum heap size of the JVM
Default: 2048m
The maximum heap size of the JVM
Default: 2048m
fleet assigns a range of 10 ports to each instance starting from port 30000. This means the first instance has a port range from 30000 to 30009, the second instance has a port range from 30010 to 30019 and so on.
Port mappings can be defined like this:
<container-type>:<source-port>:<exposed-dynamic-port>:<exposed-master-port>:<alias>
- container-type Can be either confluence or postgres.
- source-port The source port (e.g. 8090 in case of Confluence).
- exposed-dynamic-port The port under which the source port should be available on the host machine (e.g. PORT_0 references the first port of the dynamic port range. So this port would be set to 30000 on the first instance and to 30010 on the second instance).
- exposed-master-port The port under which the source port should be available on the host machine in the case the instance is the master (e.g. 8090).
- alias An alias name. This should be set to confluence in case of the main Confluence port (8090) and to postgres if it's the main Postgres port (5432).
Default: confluence:8090:PORT_0:8090:confluence,postgres:5432:PORT_1::postgres
Define up to 5 paths which will get mounted as volumes into the Confluence Docker container. For example, if you set mount-path-1 to /foo then the path /opt/mount-path-1 inside of the Confluence Docker container will link to the /foo path of the host machine.
Default: ''
fleet was developed with an API-First approach. This means, everything which can be done in the cli can also be done programmatically. Here is a short example script:
const fleet = require('@xat/fleet');
(async function() {
// add a new instance
await fleet.add('foo', { version: '6.6.3' });
// ...then start it
await fleet.start('foo');
// ...then remove it again
await fleet.remove('foo');
})();
In order to connect Confluence with the Postgres database you can use these settings:
- Host: postgres
- User: confluence
- Password: confluence
- Database: confluence
The settings, the Confluence home directories and the Postgres Databases are all stored under ~/.fleet
Copyright (c) 2018 Simon Kusterer
Licensed under the MIT license.