Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ops-git): refactor, include torture #769

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 31 additions & 41 deletions docker/ops-git/rootfs/opt/jitsi/update-repos.sh
Original file line number Diff line number Diff line change
@@ -1,53 +1,43 @@
#!/bin/bash

REPOS="infra-provisioning.git infra-configuration.git infra-customizations-private.git jitsi-meet.git jitsi-meet-torture.git"

UPDATE_DIR="/tmp/update"

export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
eval "$(ssh-agent -s)"
trap "kill $SSH_AGENT_PID" exit

ssh-add ~/.ssh/id_rsa
set -x
UPDATE_DIR="/tmp/update"
function mirrorrepo {
REPO=$1
# first do a git pull in the local repo
cd /home/git/jitsi/$REPO
git pull

# now do a mirror clone in the update dir
cd $UPDATE_DIR
/usr/bin/git clone --mirror [email protected]:jitsi/$REPO

cd /home/git/jitsi/infra-configuration.git
git pull
cd $REPO
# move into the newly cloned repo and set the push url to the local git server
git remote set-url --push origin git@localhost:jitsi/$REPO
git fetch -p origin
# mirror the repo to the local git server
git push --mirror
}

cd /home/git/jitsi/infra-provisioning.git
git pull
ssh-add ~/.ssh/id_rsa
set -x

cd /home/git/jitsi/infra-customizations-private.git
git pull
# make sure we have a clean update dir
mkdir -p $UPDATE_DIR

cd /home/git/jitsi/jitsi-meet.git
git pull
#subshell to avoid having to cd back
(
# mirror each repo
for REPO in $REPOS; do
mirrorrepo $REPO
done
)

mkdir -p $UPDATE_DIR
cd $UPDATE_DIR

/usr/bin/git clone --mirror [email protected]:jitsi/infra-configuration.git
cd infra-configuration.git
git remote set-url --push origin git@localhost:jitsi/infra-configuration.git
git fetch -p origin
git push --mirror
cd ..

/usr/bin/git clone --mirror [email protected]:jitsi/infra-provisioning.git
cd infra-provisioning.git
git remote set-url --push origin git@localhost:jitsi/infra-provisioning.git
git fetch -p origin
git push --mirror
cd ..

/usr/bin/git clone --mirror [email protected]:jitsi/infra-customizations-private.git
cd infra-customizations-private.git
git remote set-url --push origin git@localhost:jitsi/infra-customizations-private.git
git fetch -p origin
git push --mirror
cd ..

/usr/bin/git clone --mirror [email protected]:jitsi/jitsi-meet.git
cd jitsi-meet.git
git remote set-url --push origin git@localhost:jitsi/jitsi-meet.git
git fetch -p origin
git push --mirror
cd ..
rm -rf $UPDATE_DIR