]> git.immae.eu Git - github/fretlink/ansible-clever.git/blob - files/clever-deploy.sh
Don't run `clever deploy` if the app is up-to-date
[github/fretlink/ansible-clever.git] / files / clever-deploy.sh
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