Skip to content
/ BitUp Public

BitUp is an application to backup git repositories from Bitbucket. It is possible to store all repositories of specific Bitbucket Teams in Azure File Storage or to save them locally.

License

Notifications You must be signed in to change notification settings

DataOne/BitUp

Repository files navigation

BitUp

What is this repository for?

  • BitUp is an application to backup git repositories from Bitbucket.
  • It is possible to store all repositories of specific Bitbucket Teams in Azure File Storage or to save them locally.

Installation

Bitbucket prerequisites

First you need to generate api keys for every team. To do that navigate to the team page and click on the button in the upper right corner "Manage team". The keys are needed to configure the application.

bitbucketapikey

Preparing Azure

The next step is to create an Azure Storage Account. Go to the Azure Portal and sign in. Now you can navigate to "Storage accounts (classic)".

storage

Here click "Add" to add an storage account.

addstorage

Give it a unique name, change settings and click "Create".

createstorageaccount

Now you can add a storage container clicking on the created storage account then "Overview" --> "Files" --> "+ File share". Choose a name for the storage container, set a sufficient quota (to limit max size) then click "Create".

createstorage

You find the key needed for the config file at "Keys" --> "Primary Access Key".

storagekeys

Configuration

Edit the DataOne.BitUp.exe.config file.

config

  1. BitbucketTeams: A collection of strings with all names of teams to backup the repositories of. A string consists of the team's ID and the API-Key of it, separated by a semicolon.

  2. AzureStorageContainer: The name of an Azure Storage Container. It has not to exist but has to fit the naming rules: Azure Storage Naming Rules

  3. AzureAccountName: The name of an already existing Azure Storage Account.

  4. AzureAccountKey: The primary Key of the specified Azure Storage Account.

  5. StoreInAzure: A boolean value on which it depends if the backups will be saved locally or in Azure. Possible values are: True or False.

  6. SmtpHost: The smpt host of the mail server you want to use to send the log mail after each run.

  7. EmailAccount: An email account with which the log mail will be sent.

  8. EmailPassword: The corresponding password of the stated email account.

  9. SendMailTo: The email account to receive the log mail.

  10. SmptPort: The used port of the smtp host. Default values are 25 or 587, but which one will work depends on the host.

  11. MailFrom: The sender of the log mail. It is not needed to change this value.

Execution

Local

To run the application locally just execute the DataOne.BitUp.exe.

As Azure Web Job

If you want to use Azure to run it use the following steps to create a Web Job.

  1. Create a zip file containing all files from the original DataOne.BitUp.zip but where you changed the settings in the config file as you need them.

  2. Navigate to "App Services" in the Azure Portal.

    • azureportal
  3. Add a new Web App (or use an existing one).

    • addwebapp
  4. Choose an unique name for your App and click "Create".

    • createwebapp
  5. Navigate to "WebJobs" and click "Add".

    • addwebjob
  6. Give it a name and upload the DataOne.BitUp.zip file containing the updated config file.

    • Choose type "Triggered" and decide when you want the application to run.
    • To run it manually set "Triggers" to "Manual".
    • To run it at a specific time set "Triggers" to "Scheduled" and specify a valid CRON expression.
    • createwebjob
  7. If you set "Triggers" to "Manual" you can run the Web Job with a click on "Run" as shown in the next picture.

    • runwebjob

Done!

After a run you find your repository backups in the Azure Storage Container or in a local directory ./DataOne.BitUp.RepositoryBackups if you ran the application locally.

Note that only repositories that changed since the last run (assumed that it was 24 hours ago) will get backed up!

About

BitUp is an application to backup git repositories from Bitbucket. It is possible to store all repositories of specific Bitbucket Teams in Azure File Storage or to save them locally.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages