The basic configuration includes all the minimal configuration to deploy the app successfully. Create a file named boss.yml
in your project's root directory.
string
The title or name of the project or application.
project_name: PROJECT_NAME
string
A short description about your project.
project_description: PROJECT_DESCRIPTION
string
The location of repository where you or your team mates push the project.
repository_url: https://github.com/<username>/<project-name>
string
The user used to access the servers through SSH.
user: USERNAME
NOTE: This user will be used to access all the servers mentioned in stages below.
integer
The port used to access the servers through SSH.
port: SERVER_SSH_PORT
NOTE: This port will be used to access all the servers mentioned in stages below.
Stages refer to the configured remote servers where you would like to deploy your application. E.g. dev
, qa
, uat
, staging
, production
.
array
You can define stages for each of the remote servers you have. For instance:
stages:
dev:
host: dev.your-app.com
...
uat:
host: uat.your-app.com
...
...
For each of the stages, you can define the following configuration options:
string
Address of the hosted server for the defined stage.
host: dev.your-app.com
string
The user to access the defined staged server. This user overrides the user defined in basic configuration. If not defined, the user defined in basic configuration will be used.
user: DEV_SERVER_USERNAME
integer
The port to access the defined staged server. This port overrides the port defined in basic configuration. If not defined, the port defined in basic configuration will be used.
port: DEV_SERVER_SSH_PORT
string
The public url to access this website.
public_url: http://dev.your-app.com
string
The absolute path of the current working directory on the remote host.
cwd: /path/to/your/app
array
The list of logs on your remote server.
logging:
...
The log files can be listed under logging as following:
array
The list of log files. It may include host server logs, database log and others.
files:
- /path/to/access/log/file
- /path/to/error/log/file
- /path/to/database/log/file
You can configure to be notified when deployment starts to succeeds.
array
The list of different chat/IRC clients through which notifications can be sent.
notifications:
slack:
...
Currently, only slack is supported. Further integrations are welcome through pull-requests.
boolean
Enable/disable notification from slack.
enabled: true
string
Slack channel endpoint token to let boss-cli access the slack for sending notifications.
endpoint: SLACK_ENDPOINT
If you want to be notified for custom scripts just like deployments, you can list the scripts that should be notified in the notified_hooks.scripts
block as shown below.
Configuration could be as simple as:
project_name: my-app
scripts:
db_migration: 'yarn db:migrate'
db_rollback: 'yarn db:rollback'
reload: 'pm2 reload'
notifications:
slack:
...
notified_hooks:
scripts: ['reload', 'db_migration', 'db_rollback']
Now, if the user executes the command:
$ fab staging run:db_migration
In slack, the notifications would look like:
- kabir is running db_migration for my-app on staging server.
- kabir finished running db_migrate for my-app on staging server.
A sample of final configuration file:
#boss.yml
project_name: PROJECT_NAME
project_description: PROJECT_DESCRIPTION
repository_url: https://github.com/<username>/<project-name>
user: ${USERNAME}
port: ${SERVER_SSH_PORT}
stages:
dev:
host: dev.your-app.com
public_url: http://dev.your-app.com
logging:
files:
- /path/to/error/log/file
- /path/to/access/log/file
uat:
host: uat.your-app.com
public_url: http://uat.your-app.com
logging:
files:
- /path/to/error/log/file
- /path/to/access/log/file
production:
host: your-app.com
port: ${PRODUCTION_SERVER_SSH_PORT}
username: ${PRODUCTION_SERVER_USERNAME}
public_url: http://your-app.com
logging:
files:
- /path/to/error/log/file
- /path/to/access/log/file
notifications:
slack:
enabled: true
endpoint: ${SLACK_ENDPOINT}