aboutsummaryrefslogblamecommitdiffhomepage
path: root/files/clever-deploy.sh
blob: c301a89b23fb7bdef8ba9fe040473e6a63b829f6 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                                     
#!/usr/bin/env bash

function getHeadRev {
  git rev-parse HEAD
}

target_commit="$(getHeadRev)"
running_commit=$(clever status | grep running | sed 's/^.*Commit: //' | sed 's/)$//')

if [ "${running_commit}" != "${target_commit}" ]; then
  echo "Deploying commit ${target_commit}"
  clever deploy --force
else
  echo "${target_commit} is already deployed, nothing to do"
fi