aboutsummaryrefslogtreecommitdiffhomepage
path: root/files/clever-deploy.sh
diff options
context:
space:
mode:
Diffstat (limited to 'files/clever-deploy.sh')
-rwxr-xr-xfiles/clever-deploy.sh15
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
3function getHeadRev {
4 git rev-parse HEAD
5}
6
7target_commit="$(getHeadRev)"
8running_commit=$(clever status | grep running | sed 's/^.*Commit: //' | sed 's/)$//')
9
10if [ "${running_commit}" != "${target_commit}" ]; then
11 echo "Deploying commit ${target_commit}"
12 clever deploy --force
13else
14 echo "${target_commit} is already deployed, nothing to do"
15fi