]> git.immae.eu Git - github/fretlink/ansible-clever.git/blame - tests/fake.sh
Merge pull request #72 from clementd-fretlink/noop-if-up-to-date
[github/fretlink/ansible-clever.git] / tests / fake.sh
CommitLineData
c99eb178
PB
1#!/usr/bin/env bash
2
3binary="${0/*\/}"
783f91c2
CD
4localCommit="${PRETEND_LOCAL_COMMIT:-aaa000aaa000aaa000aaa000aaa000aaa000aaa0}"
5remoteCommit="${PRETEND_REMOTE_COMMIT:-bbb000bbb000bbb000bbb000bbb000bbb000bbb0}"
c99eb178
PB
6
7if [ "${binary}" = "clever" ] && [ "${1}" = "--version" ]; then
b89d0540 8 echo "2.6.1"
c99eb178 9elif [ "${binary}" = "clever" ] && [ "${1}" = "activity" ]; then
783f91c2
CD
10 echo "2020-02-02T20:20:02+02:00 OK DEPLOY ${remoteCommit} Git"
11elif [ "${binary}" = "clever" ] && [ "${1}" = "status" ]; then
12 echo "test-app: running (1*pico, Commit: ${remoteCommit})"
c99eb178 13elif [ "${binary}" = "git" ]; then
783f91c2 14 echo "${localCommit}"
c99eb178
PB
15else
16 echo "${binary} called with arguments: ${*}"
17fi
545c41a6
CD
18
19echo "${1}" >> "${binary}-commands"