aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/fake.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fake.sh')
-rwxr-xr-xtests/fake.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/fake.sh b/tests/fake.sh
index 65ff819..776907b 100755
--- a/tests/fake.sh
+++ b/tests/fake.sh
@@ -3,6 +3,9 @@
3binary="${0/*\/}" 3binary="${0/*\/}"
4localCommit="${PRETEND_LOCAL_COMMIT:-aaa000aaa000aaa000aaa000aaa000aaa000aaa0}" 4localCommit="${PRETEND_LOCAL_COMMIT:-aaa000aaa000aaa000aaa000aaa000aaa000aaa0}"
5remoteCommit="${PRETEND_REMOTE_COMMIT:-bbb000bbb000bbb000bbb000bbb000bbb000bbb0}" 5remoteCommit="${PRETEND_REMOTE_COMMIT:-bbb000bbb000bbb000bbb000bbb000bbb000bbb0}"
6uptodateDeployment="${DEPLOY_UP_TO_DATE_APP:-}"
7
8echo "${1}" >> "${binary}-commands"
6 9
7if [ "${binary}" = "clever" ] && [ "${1}" = "--version" ]; then 10if [ "${binary}" = "clever" ] && [ "${1}" = "--version" ]; then
8 echo "2.6.1" 11 echo "2.6.1"
@@ -10,10 +13,17 @@ elif [ "${binary}" = "clever" ] && [ "${1}" = "activity" ]; then
10 echo "2020-02-02T20:20:02+02:00 OK DEPLOY ${remoteCommit} Git" 13 echo "2020-02-02T20:20:02+02:00 OK DEPLOY ${remoteCommit} Git"
11elif [ "${binary}" = "clever" ] && [ "${1}" = "status" ]; then 14elif [ "${binary}" = "clever" ] && [ "${1}" = "status" ]; then
12 echo "test-app: running (1*pico, Commit: ${remoteCommit})" 15 echo "test-app: running (1*pico, Commit: ${remoteCommit})"
16elif [ "${binary}" = "clever" ] && [ "${1}" = "deploy" ]; then
17 if [ -z "${uptodateDeployment}" ]; then
18 echo "Clever deploy done."
19 else
20 # Mimic the current behavior until https://github.com/CleverCloud/clever-tools/issues/422 is solved
21 >&2 echo "The clever-cloud application is up-to-date. Try this command to restart the application:"
22 >&2 echo " clever restart"
23 exit 1
24 fi
13elif [ "${binary}" = "git" ]; then 25elif [ "${binary}" = "git" ]; then
14 echo "${localCommit}" 26 echo "${localCommit}"
15else 27else
16 echo "${binary} called with arguments: ${*}" 28 echo "${binary} called with arguments: ${*}"
17fi 29fi
18
19echo "${1}" >> "${binary}-commands"