concourse-ssh-resource/check

25 lines
433 B
Bash
Executable file

#!/usr/bin/env sh
set -e
set -o pipefail
[ -e /opt/resource/common ] && cd /opt/resource/
. ./common
version="$(compute_version "$(fetch_file_infos get_files)")"
if [ "$(echo "$version" | jq -r tostring)" = "$(get_version | jq -r .files | jq -r tostring)" ]; then
get_version
cleanup
exit 0
fi
jq -r tostring << EOF
{
"version": {
"files": $version,
"time": $(date +%s)
}
}
EOF
cleanup
exit 0