diff options
author | Clément Delafargue <39330590+clementd-fretlink@users.noreply.github.com> | 2020-06-30 16:31:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-30 16:31:26 +0200 |
commit | 90634ee04cc1a4ab983de6bf142f25978463bc4a (patch) | |
tree | 3b1fa1a9e85d57dbf4f4071321f9011343f40ac6 /tests/fake.sh | |
parent | 44e55b1d81f5defe28249d6b70b894c1ebad7c91 (diff) | |
parent | db630aaa8b261503076eb7320ee3cee5a5582be8 (diff) | |
download | ansible-clever-90634ee04cc1a4ab983de6bf142f25978463bc4a.tar.gz ansible-clever-90634ee04cc1a4ab983de6bf142f25978463bc4a.tar.zst ansible-clever-90634ee04cc1a4ab983de6bf142f25978463bc4a.zip |
Merge pull request #72 from clementd-fretlink/noop-if-up-to-date
don't run `clever deploy` if the app is up-to-date
Diffstat (limited to 'tests/fake.sh')
-rwxr-xr-x | tests/fake.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/fake.sh b/tests/fake.sh index bbb4380..65ff819 100755 --- a/tests/fake.sh +++ b/tests/fake.sh | |||
@@ -1,15 +1,19 @@ | |||
1 | #!/usr/bin/env bash | 1 | #!/usr/bin/env bash |
2 | 2 | ||
3 | binary="${0/*\/}" | 3 | binary="${0/*\/}" |
4 | fakeCommit="aaa000aaa000aaa000aaa000aaa000aaa000aaa0" | 4 | localCommit="${PRETEND_LOCAL_COMMIT:-aaa000aaa000aaa000aaa000aaa000aaa000aaa0}" |
5 | remoteCommit="${PRETEND_REMOTE_COMMIT:-bbb000bbb000bbb000bbb000bbb000bbb000bbb0}" | ||
5 | 6 | ||
6 | if [ "${binary}" = "clever" ] && [ "${1}" = "--version" ]; then | 7 | if [ "${binary}" = "clever" ] && [ "${1}" = "--version" ]; then |
7 | echo "2.6.1" | 8 | echo "2.6.1" |
8 | elif [ "${binary}" = "clever" ] && [ "${1}" = "activity" ]; then | 9 | elif [ "${binary}" = "clever" ] && [ "${1}" = "activity" ]; then |
9 | echo "2020-02-02T20:20:02+02:00 OK DEPLOY ${fakeCommit} Git" | 10 | echo "2020-02-02T20:20:02+02:00 OK DEPLOY ${remoteCommit} Git" |
11 | elif [ "${binary}" = "clever" ] && [ "${1}" = "status" ]; then | ||
12 | echo "test-app: running (1*pico, Commit: ${remoteCommit})" | ||
10 | elif [ "${binary}" = "git" ]; then | 13 | elif [ "${binary}" = "git" ]; then |
11 | echo "${fakeCommit}" | 14 | echo "${localCommit}" |
12 | else | 15 | else |
13 | echo "${1}" >> "${binary}-commands" | ||
14 | echo "${binary} called with arguments: ${*}" | 16 | echo "${binary} called with arguments: ${*}" |
15 | fi | 17 | fi |
18 | |||
19 | echo "${1}" >> "${binary}-commands" | ||