Coder Social home page Coder Social logo

silentsoul04 / git-mirror-automation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from danielscholl/git-mirror-automation

0.0 1.0 0.0 358 KB

Automatically mirror repositories between Github, Gitlab & Azure DevOps

License: MIT License

C# 99.75% Shell 0.25%

git-mirror-automation's Introduction

Git mirror automation

Automate the mirroring of git repositories across multiple services (such as github, gitlab & Azure DevOps).

Motivation

A long time ago I wrote about mirroring github, gitlab and Azure DevOps repositories.

I still use this workflow (with slight improvements) to mirror repositories but it still required a set of manual steps. I decided to automate them with this azure function.

Manual steps this project solves

While using the automation steps described in my blog post there are still manual steps left after creating a repository in github:

  • Sign into and create the same repository in Gitlab
    • Set the same description as github
  • Sign into and create the same repository in Azure DevOps
  • Create a new mirror build in Azure DevOps (by cloning an existing one and updating the source repository)

How it works

The azure function runs on a schedule and uses configuration files to scan the source for any new repositories.

If new repositories are found the function uses the APIs for Azure DevOps/Gitlab to create the necessary repository/build pipelines.

Once the build pipeline exists it is triggered on every push as well as a schedule to mirror the repository.

(I use Azure DevOps builds instead of github actions because Azure DevOps allows secret sharing across pipelines).

Overview & Supported features

Mirror repositories between Github, Gitlab & Azure DevOps using free Azure Pipelines for mirror automation!

Architecture

The service has 3 major parts, all of them are executed as part of the Azure function once for every configuration file (loaded from storage):

  • (1) Then function scans the source (by default every 5 minutes) for new repositories
  • (2) For every new repository it creates a build that automatically mirrors the repository on any future changes (git push on any branch)
  • (3) And finally it creates the target repositories (with identical names) at the desired target services

See configuration, supported sources, supported mirrors and supported targets for more details on each.

Examples

Examples can be found here.

git-mirror-automation's People

Contributors

interloper7 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.