Add post-create hook

Note that this is invoked *before* the application is deployed, so it's usage is quite different than a potential post-successful-create hook.
This commit is contained in:
Jose Diaz-Gonzalez
2015-11-25 19:11:32 -05:00
parent e0143ed226
commit 8e9d04ae36
4 changed files with 38 additions and 6 deletions

View File

@@ -380,6 +380,27 @@ docker commit $id $IMAGE > /dev/null
dokku_log_info1 "Building UI Complete"
```
### `post-create`
- Description: Can be used to run commands after an application is created.
- Invoked by: `dokku apps:create`
- Arguments: `$APP`
- Example:
```shell
#!/usr/bin/env bash
# Runs a command to ensure that an app
# has a postgres database when it is starting
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
APP="$1";
POSTGRES="$1"
dokku postgres:create $POSTGRES
dokku postgres:link $POSTGRES $APP
```
### `post-deploy`
- Description: Allows running of commands after a deploy has completed. Dokku core currently uses this to switch traffic on nginx.