Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for running a script at the end of the compile (via POST_SCRIPT env var) #76

Merged
merged 2 commits into from
Aug 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,7 @@ git add cabal.config
You can change build settings through Heroku environment variables.

```sh
# allow the buildpack to see environment vars
heroku labs:enable buildpack-env-arg

# then set the variable of your choice
# set the variable of your choice
heroku config:set VARIABLE=value
```

Expand Down Expand Up @@ -144,6 +141,11 @@ Here are the options
<td>Path to an executable, relative to checkout root. If present, this will be chmodded (+x) and ran before anything else.</td>
<td></td>
</tr>
<tr>
<td>POST_SCRIPT</td>
<td>Path to an executable, relative to checkout root. If present, this will be chmodded (+x) and ran after anything else.</td>
<td></td>
</tr>
</tbody>
</table>

Expand Down
7 changes: 7 additions & 0 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -300,3 +300,10 @@ if [ -d $WORKING_HOME/.cabal-sandbox ]; then
cp -R $WORKING_HOME/.cabal-sandbox $BUILD_DIR
fi

# run user post-script
POST_SCRIPT_FULL="$BUILD_DIR/$POST_SCRIPT"
if [ -f "$POST_SCRIPT_FULL" ]; then
echo "-----> Running POST_SCRIPT: $POST_SCRIPT"
chmod +x $POST_SCRIPT_FULL
$POST_SCRIPT_FULL "$BUILD_DIR" "$CACHE_DIR $ENV_DIR"
fi