#!/bin/sh # import trusted fingerprints mkdir "$HOME/.ssh" echo "$SSH_HOST_KEY" > "$HOME/.ssh/known_hosts" # use a custom ssh key for git export GIT_SSH_COMMAND="ssh -i ""$SSH_PRIVATE_KEY""" docker pull gitea.lubiland.de/lubiland/swarm-nat while :; do # check if the git repository already got cloned if [ -d .git ]; then # update the git repository git pull else # no repository found; do an initial clone git clone "$REPOSITORY" . fi # run the actual swarm-nat docker container docker run --rm --net=host --cap-add=NET_ADMIN --volume /var/run/docker.sock:/var/run/docker.sock --volume /cephfs/lubiland-lubinat/lubidock/stacks:/stacks gitea.lubiland.de/lubiland/swarm-nat sleep 60 done