diff options
Diffstat (limited to 'files/clever-deploy.sh')
-rwxr-xr-x | files/clever-deploy.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/files/clever-deploy.sh b/files/clever-deploy.sh new file mode 100755 index 0000000..c301a89 --- /dev/null +++ b/files/clever-deploy.sh | |||
@@ -0,0 +1,15 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | function getHeadRev { | ||
4 | git rev-parse HEAD | ||
5 | } | ||
6 | |||
7 | target_commit="$(getHeadRev)" | ||
8 | running_commit=$(clever status | grep running | sed 's/^.*Commit: //' | sed 's/)$//') | ||
9 | |||
10 | if [ "${running_commit}" != "${target_commit}" ]; then | ||
11 | echo "Deploying commit ${target_commit}" | ||
12 | clever deploy --force | ||
13 | else | ||
14 | echo "${target_commit} is already deployed, nothing to do" | ||
15 | fi | ||