Skip to content

Instantly share code, notes, and snippets.

@maxwellb
Created November 22, 2022 06:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxwellb/2001e496b5f0eb43733fc571934e86d7 to your computer and use it in GitHub Desktop.
Save maxwellb/2001e496b5f0eb43733fc571934e86d7 to your computer and use it in GitHub Desktop.
Update my repos in GitHub to remain in sync with the upstream projects
## Update my repos in GitHub to remain in sync with the upstream projects
variables:
- group: Sensitive Values
pool:
vmImage: ubuntu-latest
schedules:
- cron: 0 12 * * *
displayName: Daily
always: true
branches:
include:
- master
stages:
- stage: start
displayName: Start
jobs:
- job: default
steps:
- bash: |
echo "Get the party started"
- stage: sync
displayName: Sync Repos with Upstream
dependsOn: start
jobs:
- job: sync
strategy:
matrix:
akka.net:
REPO: akka.net
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/akkadotnet/akka.net.git
SSHP: $(cicd-rsa)
BRANCHES: dev
Akka.Persistence.Cassandra:
REPO: Akka.Persistence.Cassandra
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/akkadotnet/Akka.Persistence.Cassandra.git
SSHP: $(cicd-rsa)
BRANCHES: dev master
Akka.Persistence.MongoDB:
REPO: Akka.Persistence.MongoDB
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/akkadotnet/Akka.Persistence.MongoDB.git
SSHP: $(cicd-rsa)
BRANCHES: dev master
Akka.TestKit.Nunit:
REPO: Akka.TestKit.Nunit
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/AkkaNetContrib/Akka.TestKit.Nunit.git
SSHP: $(cicd-rsa)
BRANCHES: dev master
Akka.TestKit.VsTest:
REPO: Akka.TestKit.VsTest
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/AkkaNetContrib/Akka.TestKit.VsTest.git
SSHP: $(cicd-rsa)
BRANCHES: dev master
akkadotnet-bootstrap:
REPO: akkadotnet-bootstrap
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/petabridge/akkadotnet-bootstrap.git
SSHP: $(cicd-rsa)
BRANCHES: dev
ccm:
REPO: ccm
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/riptano/ccm.git
SSHP: $(cicd-rsa)
chromeos_azure_file_share:
REPO: chromeos_azure_file_share
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/GoogleChromeLabs/chromeos_network_file_share.git
SSHP: $(cicd-rsa)
compose:
REPO: compose
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/docker/compose.git
SSHP: $(cicd-rsa)
csharp-driver:
REPO: csharp-driver
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/datastax/csharp-driver.git
SSHP: $(cicd-rsa)
donuts.node:
REPO: donuts.node
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/microsoft/donuts.node.git
SSHP: $(cicd-rsa)
dotnet-docs:
REPO: dotnet-docs
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/dotnet/docs.git
SSHP: $(cicd-rsa)
BRANCHES: main
dotnet-samples:
REPO: dotnet-samples
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/dotnet/samples.git
SSHP: $(cicd-rsa)
ffmpeg:
REPO: FFmpeg
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/FFmpeg/FFmpeg.git
SSHP: $(cicd-rsa)
BRANCHES: master release/4.3 release/3.4
generator-akkadotnet:
REPO: generator-akkadotnet
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/akkadotnet/generator-akkadotnet.git
SSHP: $(cicd-rsa)
hrx:
REPO: hrx
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/google/hrx.git
SSHP: $(cicd-rsa)
infinite-key-generator:
REPO: infinite-key-generator
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/signicode/infinite-key-generator.git
SSHP: $(cicd-rsa)
jus:
REPO: jus
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/jus/jus.git
SSHP: $(cicd-rsa)
keystone-storage-adapter-azure:
REPO: keystone-storage-adapter-azure
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/keystonejs/keystone-storage-adapter-azure.git
SSHP: $(cicd-rsa)
konterball:
REPO: konterball
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/madebywild/konterball.git
SSHP: $(cicd-rsa)
meshblu:
REPO: konterball
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/octoblu/meshblu.git
SSHP: $(cicd-rsa)
Microsoft.IO.RecyclableMemoryStream:
REPO: Microsoft.IO.RecyclableMemoryStream
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/microsoft/Microsoft.IO.RecyclableMemoryStream.git
SSHP: $(cicd-rsa)
monaco-mediawiki:
REPO: monaco-mediawiki
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/imbushuo/monaco-mediawiki.git
SSHP: $(cicd-rsa)
open-api:
REPO: open-api
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/kogosoftwarellc/open-api.git
SSHP: $(cicd-rsa)
Oryx:
REPO: Oryx
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/microsoft/Oryx.git
SSHP: $(cicd-rsa)
rdm-asyncfuture:
REPO: rdm-asyncfuture
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/benlau/asyncfuture.git
SSHP: $(cicd-rsa)
rdm-breakpad:
REPO: rdm-breakpad
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/google/breakpad.git
SSHP: $(cicd-rsa)
rdm-CrashReporter:
REPO: rdm-CrashReporter
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/RedisDesktop/CrashReporter.git
SSHP: $(cicd-rsa)
rdm-easyloggingpp:
REPO: rdm-easyloggingpp
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/zuhd-org/easyloggingpp.git
SSHP: $(cicd-rsa)
rdm-hiredis:
REPO: rdm-hiredis
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/redis/hiredis.git
SSHP: $(cicd-rsa)
rdm-libssh2:
REPO: rdm-libssh2
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/libssh2/libssh2.git
SSHP: $(cicd-rsa)
rdm-native-value-formatters:
REPO: rdm-native-value-formatters
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/RedisDesktop/rdm-native-value-formatters.git
SSHP: $(cicd-rsa)
rdm-qredisclient:
REPO: rdm-qredisclient
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/uglide/qrediscliente.git
SSHP: $(cicd-rsa)
rdm-qsshclient:
REPO: rdm-qsshclient
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/uglide/qsshclient.git
SSHP: $(cicd-rsa)
rdm-qt-unix-signals:
REPO: rdm-qt-unix-signals
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/nyalldawson/qt-unix-signals
SSHP: $(cicd-rsa)
RedisDesktopManager:
REPO: RedisDesktopManager
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/uglide/RedisDesktopManager.git
SSHP: $(cicd-rsa)
BRANCHES: "2020 2019"
ssh2:
REPO: ssh2
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/mscdex/ssh2.git
SSHP: $(cicd-rsa)
tigerbrew:
REPO: tigerbrew
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/mistydemeo/tigerbrew.git
SSHP: $(cicd-rsa)
unity:
REPO: unity
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/unitycontainer/unity.git
SSHP: $(cicd-rsa)
voldemort:
REPO: voldemort
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/voldemort/voldemort.git
SSHP: $(cicd-rsa)
winforms:
REPO: winforms
USER: maxwellb
HOST: git@github.com
ORIGIN: github.com
UPSTREAM: github.com
FORK: https://github.com/dotnet/winforms.git
SSHP: $(cicd-rsa)
steps:
- task: DownloadSecureFile@1
displayName: Get SSH key
name: ssh_key
inputs:
secureFile: cicd_rsa
- bash: |
eval "$(ssh-agent)"
chmod 0600 $(ssh_key.secureFilePath)
echo ${SSHP} | ssh-add $(ssh_key.secureFilePath)
resolv() {
dig "${1}" | grep -v '^;' | grep 'IN.*A' | awk '{ print $5 }'
}
addhost() {
mkdir -p ~/.ssh
ssh-keyscan -H ${1} | tee -a ~/.ssh/known_hosts
ssh-keyscan -H $(resolv ${1}) | tee -a ~/.ssh/known_hosts
ssh-keyscan -H ${1},$(resolv ${1}) | tee -a ~/.ssh/known_hosts
chmod 0600 ~/.ssh/known_hosts
}
addhost ${ORIGIN}
addhost ${UPSTREAM}
if (echo "${BRANCHES}" | grep '^\$'); then
BRANCHES=""
fi
git clone "${HOST}:${USER}/${REPO}.git" src
cd src
git checkout --detach
git remote add upstream "${FORK}"
git fetch upstream
for branch in ${BRANCHES:-master}; do
echo "Remote upstream:${branch} is $(git log --oneline ${branch}..upstream/${branch} | wc -l) ahead"
echo "Remote upstream:${branch} is $(git log --oneline upstream/${branch}..${branch} | wc -l) behind"
git fetch . upstream/${branch}:${branch}
git push origin "${branch}"
done
env:
REPO: $(REPO)
USER: $(USER)
HOST: $(HOST)
ORIGIN: $(ORIGIN)
UPSTREAM: $(UPSTREAM)
FORK: $(FORK)
SSHP: $(SSHP)
BRANCHES: $(BRANCHES)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment