#git - April 2020

gitArchived
21 messages

All things git (except gitops)

Zachary Loeber
Zachary Loeberover 6 years ago
The way I'm understanding Go modules it appears that git tags are pretty much mandatory for any real projects, anyone care to tell me that is a misconception?
Alan Jenkins
Alan Jenkinsover 6 years ago
@Alan Jenkins has joined the channel
Zachary Loeber
Zachary Loeberover 6 years ago
For those of you that mostly get gitflow but could use a visualization once in a while to grok the 10+ year old model that everyone seems smitten over: https://veerasundar.com/blog/2018/03/gitflow-animated/
Zachary Loeber
Zachary Loeberover 6 years ago
github being down for me right now is a bummer. God help those pipelines that have code that manually goes out and pulls resources from it as a regular (bad) practice. Pointed reminder to keep your build/deploy base containers cached in your container repos.
RB (pat leave again)
RB (pat leave again)over 6 years ago
@RB (pat leave again) has joined the channel
RB
RBover 6 years ago(edited)
wish we had a github backup for when they have issues. if we had something that synchronized all of our org, we could have our remotes all point to that which would redirect to github, but if github was having issues, it would point to its own cache until the issues get resolved.

does anything like that exist?
ikar
ikarover 6 years ago
we use simple script for backup to AWS CodeCommit:
$ cat git_sync.sh 
#!/bin/bash

FAIL=true

cd /home/ubuntu/$1 && git fetch origin --prune && git push --mirror && FAIL=false

if $FAIL
then
        /usr/local/bin/slack.sh "WARNING: hourly repository sync *failed!!!*..." "#alerts"
fi
ikar
ikarover 6 years ago
you have to have a bare repo for that, maybe I'll find some doc...
ikar
ikarover 6 years ago
extracted from ansible:
• you need to clone in mirror mode: git clone --mirror URL
• and set second remote to the repo: git remote set-url --push origin BACKUP_URL
RB
RBover 6 years ago
how does the script run? is it a commit hook ?
RB
RBover 6 years ago
how do you do this for an entire org on github ?
ikar
ikarover 6 years ago
we run that once per hour on a server
ikar
ikarover 6 years ago
for each repo separately
RB
RBover 6 years ago
makes sense so when github is down or intermittent, are all of your remotes sent to the sync'ed mirror
RB
RBover 6 years ago
how does the mirror switch between github and aws codecommit ?
RB
RBover 6 years ago
and when things are committed to codecommit instead of github, how do you pull those changes back to github ?
RB
RBover 6 years ago
or is codecommit only intended to be a readonly mirror ?
ikar
ikarover 6 years ago
yup, codecommit is just readonly mirror for cases you need to deploy
ikar
ikarover 6 years ago(edited)
quite interested in smarter solutions though 🙂
RB
RBover 6 years ago
ah ok seems like a good fallback for readonly
RB
RBover 6 years ago
ideally - mirror syncs ever 15 min every branch and repo in org
- all repos remote is set to urls that point to github
- github problem is detected, all repos remotes dont have to change, the urls now redirect to the mirror
- devs change code in branches, commit, push code
- devs still have access to pr system, comments, etc
- github is no longer having issues, system now syncs differences with github
- urls now redirect back to github

basically a github enterprise onprem lol

with some logic to sync it with the cloud solution

¯\(ツ)/¯