From 783f91c2e0228ef9e057b810b4b60c4f669ebab4 Mon Sep 17 00:00:00 2001 From: Clement Delafargue Date: Tue, 30 Jun 2020 09:30:04 +0200 Subject: Make commit ids overridable in the script mock --- tests/fake.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/fake.sh b/tests/fake.sh index bbb4380..0303b61 100755 --- a/tests/fake.sh +++ b/tests/fake.sh @@ -1,14 +1,17 @@ #!/usr/bin/env bash binary="${0/*\/}" -fakeCommit="aaa000aaa000aaa000aaa000aaa000aaa000aaa0" +localCommit="${PRETEND_LOCAL_COMMIT:-aaa000aaa000aaa000aaa000aaa000aaa000aaa0}" +remoteCommit="${PRETEND_REMOTE_COMMIT:-bbb000bbb000bbb000bbb000bbb000bbb000bbb0}" if [ "${binary}" = "clever" ] && [ "${1}" = "--version" ]; then echo "2.6.1" elif [ "${binary}" = "clever" ] && [ "${1}" = "activity" ]; then - echo "2020-02-02T20:20:02+02:00 OK DEPLOY ${fakeCommit} Git" + echo "2020-02-02T20:20:02+02:00 OK DEPLOY ${remoteCommit} Git" +elif [ "${binary}" = "clever" ] && [ "${1}" = "status" ]; then + echo "test-app: running (1*pico, Commit: ${remoteCommit})" elif [ "${binary}" = "git" ]; then - echo "${fakeCommit}" + echo "${localCommit}" else echo "${1}" >> "${binary}-commands" echo "${binary} called with arguments: ${*}" -- cgit v1.2.3