]> git.immae.eu Git - github/fretlink/ansible-clever.git/blob - tests/fake.sh
Make commit ids overridable in the script mock
[github/fretlink/ansible-clever.git] / tests / fake.sh
1 #!/usr/bin/env bash
2
3 binary="${0/*\/}"
4 localCommit="${PRETEND_LOCAL_COMMIT:-aaa000aaa000aaa000aaa000aaa000aaa000aaa0}"
5 remoteCommit="${PRETEND_REMOTE_COMMIT:-bbb000bbb000bbb000bbb000bbb000bbb000bbb0}"
6
7 if [ "${binary}" = "clever" ] && [ "${1}" = "--version" ]; then
8 echo "2.6.1"
9 elif [ "${binary}" = "clever" ] && [ "${1}" = "activity" ]; then
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})"
13 elif [ "${binary}" = "git" ]; then
14 echo "${localCommit}"
15 else
16 echo "${1}" >> "${binary}-commands"
17 echo "${binary} called with arguments: ${*}"
18 fi