2023-10-10 08:53:27 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -u
|
|
|
|
# DEBUG
|
|
|
|
set -x
|
|
|
|
|
|
|
|
# clone or pull git repo
|
|
|
|
_pull() {
|
|
|
|
myurl="${1}"
|
2024-01-24 00:05:37 +00:00
|
|
|
expected_branch="${2}"
|
2023-10-10 09:08:32 +00:00
|
|
|
mydir_raw="$(basename "${myurl}")"
|
|
|
|
mydir="${mydir_raw%.git}"
|
2023-10-10 08:53:27 +00:00
|
|
|
|
|
|
|
if [ -d "${mydir}" ]; then
|
|
|
|
cd "${mydir}"
|
2024-01-24 00:05:37 +00:00
|
|
|
current_branch="$(git branch --show-current)"
|
|
|
|
# ensure we are in the right branch without invalidating docker build cache
|
|
|
|
# yes, even without no branch switch and no new commits
|
|
|
|
if [ ! "${current_branch}" = "${expected_branch}" ]; then
|
|
|
|
git checkout "${expected_branch}"
|
|
|
|
fi
|
2023-10-10 08:53:27 +00:00
|
|
|
git pull
|
|
|
|
cd -
|
|
|
|
else
|
2024-01-24 00:05:37 +00:00
|
|
|
git clone -b "${expected_branch}" "${myurl}" "${mydir}"
|
2023-10-10 08:53:27 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
main() {
|
2024-01-24 00:05:37 +00:00
|
|
|
figlet 'pull repositories'
|
2023-10-10 08:53:27 +00:00
|
|
|
_pull 'https://gitea.pangea.org/pangea/django-orchestra' 'sso'
|
|
|
|
_pull 'https://gitea.pangea.org/pangea/django-musician' 'sso'
|
2023-10-10 09:08:32 +00:00
|
|
|
_pull 'git@gitea.pangea.org:trustchain-oc1-orchestral/IdHub.git' 'main'
|
2024-01-23 09:41:20 +00:00
|
|
|
_pull 'git@gitea.pangea.org:trustchain-oc1-orchestral/authentik.git' 'trustchain-oc1-orchestral'
|
|
|
|
# we only use this to get idhub dependency
|
|
|
|
# didkit-0.3.2-cp311-cp311-manylinux_2_34_x86_64.whl
|
|
|
|
_pull 'git@gitea.pangea.org:trustchain-oc1-orchestral/ssikit_trustchain.git' 'master'
|
|
|
|
|
2023-10-10 08:53:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
main "${@}"
|
|
|
|
|