#!/bin/sh set -eu cd /work rm -rf /work/unidesk started_at=$(date -Iseconds) echo "branch-follower one-shot started ${started_at}" /etc/unidesk-cicd-branch-follower/sync-source.sh \ "${UNIDESK_CONTROLLER_SOURCE_REPOSITORY}" \ "${UNIDESK_CONTROLLER_SOURCE_BRANCH}" \ "${UNIDESK_CONTROLLER_SOURCE_SNAPSHOT_PREFIX}" \ "/cache/${UNIDESK_CONTROLLER_SOURCE_REPOSITORY}.git" git clone --branch "${UNIDESK_CONTROLLER_SOURCE_BRANCH}" "/cache/${UNIDESK_CONTROLLER_SOURCE_REPOSITORY}.git" /work/unidesk cp /etc/unidesk-cicd-branch-follower/cicd-branch-followers.yaml /work/unidesk/config/cicd-branch-followers.yaml cd /work/unidesk "$@" echo "branch-follower one-shot finished $(date -Iseconds)"