Skip to content

Commit

Permalink
feat: Allows to execute before/after hooks when deploying a service (c…
Browse files Browse the repository at this point in the history
…lose #204) [skip build]
  • Loading branch information
Christophe Nouguier committed Dec 7, 2020
1 parent 7089ee0 commit d4eff2b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion docs/guides/advanced-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ $mongo --host mongodb0 --eval 'rs.initiate({ _id: "mongors", version: 1, members
$mongo --host mongodb0 --eval 'rs.status()'
```


### Troubleshooting the Replica Set

A member of a replica set could enter `RECOVERING` state when it is not ready to accept reads.
Expand Down Expand Up @@ -321,6 +320,17 @@ For each service, you need to declare a variable in the `.env` file which tell t
Before deploying, do not forget to make the **merged configuration** using the [configure](../reference/cli.md#configure) command.
:::

## Using hooks

Sometimes, it may be useful to execute some scripts before or after a service is deployed. This is the purpose of the hooks.
To declare a before or an after hook, create a script in the `deploy` folder named `<service>_before.sh` or `<service>_after.sh`.
The script will automatically executed when deploying the service.

::: warning
Note that `after` hooks are executed once the complete stack is deployed.
:::


## Packaging the services

It may be useful to package images of certain services (be.g. built services) to store a version or to deliver to a client who cannot access the registers.
Expand Down

0 comments on commit d4eff2b

Please sign in to comment.