GithubHelp home page GithubHelp logo

malcolmmielle / azure-devops-repository-backup Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lionelpere/azure-devops-repository-backup

0.0 0.0 0.0 46 KB

Bash script to backup all the repositories of an Azure DevOps organization

License: GNU General Public License v3.0

Shell 94.84% Dockerfile 5.16%

azure-devops-repository-backup's Introduction

azure-devops-repository-backup

💡 Introduction

Microsoft doesn't provide any built-in solution to backup the Azure Devops Services.

They ask them to trust the process as described in the Data Protection Overview page.

However most companies want to keep an on-premise backup of their code repositories for their Disaster Recovery Plan (DRP).

Project

This project provides a bash script to backup all azure devops repositories of an Azure Devops Organization.

A PowerShell version of this script has been developped by Pacman1988

🔥 Bash Script

Prerequisite

  • Shell bash (If you're running on windows, use WSL2 to easily run a GNU/Linux environment)
  • Azure CLI : Installation guide
  • Azure CLI - Devops Extension : Installation guide
  • jq, base64 packages (available in most Linux distributions)

Interaction with the Azure DevOps API requires a personal access token.

For this backup script you'll only need to generate a PAT with read access on Code

💻 Launch script

version

Release notes

./backup-devops.sh -o DEVOPS_ORG_URL -p DEVOPS_PAT -d BACKUP_DIRECTORY --dryrun true --verbose true

Parameters:
   -o | --organization: 
        The azure devops organisation URL (eg: https://dev.azure.com/my-company)
   -d | --directory: 
        The directory where to store the backup archive.
   -p | --pat: The Personnal Access Token (PAT) that you need to generate for your Azure Devops Account
   -x|--dryrun: true/false - If you want to create a dummy file instead of cloning the repositories
   -w|--projectwiki: true/false - If you want also backup the Wiki structure of the projects
   -v|--verbose true/false - Verbose mode

🐳 Use this in docker

  • Stable image version version
  • Based on script version: script

If you don't want to install all those prerequisities or you want to isolate this process, you can run this task in a docker image.

The docker image and its documentation is available on Docker Hub (lionelpere/azure-devops-repository-backup)

💻 Launch script

docker run 
    -v ´YOUR_LOCAL_BACKUP_DIRECTORY`:/data
    -e DEVOPS_PAT=`YOUR_PAT`
    -e DEVOPS_ORG_URL=`YOUR_ORGANISATION_URL` 
    -e RETENTION_IN_DAYS=7 # Will delete all files older than 7 days in the backup directory
    -e DRY_RUN=true # Will create a dummy file instead of cloning the repository
    -e WIKI=true # If you want also backup the Wiki structure of the projects
    lionelpere/azure-devops-repository-backup 

azure-devops-repository-backup's People

Contributors

lionelpere avatar elimisteve avatar tylercode avatar daviddesloovere avatar janknieling avatar malcolmmielle avatar tomdess avatar sorrentinov 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.