Github organization archive organizer
This program is meant to run as a cron job.
It will do these things;
- Start a Github Migration
- Wait for the GH Migration to be ready for downloading
- Download the archive
- Upload the archive to AZ Blob storage with a metadata
retentionClass
value - Delete blobs where the retention limit is reached
- Exit
ms-continuus is configured entirely with environment variables.
Name | Default | Description |
---|---|---|
BLOB_TAG: | "weekly"("monthly" on first week of month) | Which value to use for the uploaded retentionClass metadata |
BLOB_CONTAINER: | "github-archives" | Container in a Azure StorageAccount where the blobs will be stored |
GITHUB_ORG: | null | Target Github organization |
WEEKLY_RETENTION: | 60 | Delete blobs with retentionClass='weekly' older than n-days |
MONTHLY_RETENTION: | 230 | Delete blobs with retentionClass='monthly' older than n-days |
YEARLY_RETENTION: | 420 | Delete blobs with retentionClass='yearly' older than n-days |
GITHUB_TOKEN: | null | Required: Github Personal Access Token |
STORAGE_ACCOUNT_CON_STRING: | null | Required: Azure StorageAccount ConnectionString |
LifeCycleManagement is configured to delete old blobs following these rules;
- Blobs tagged with
retentionClass='weekly'
will be deleted after 60 days - Blobs tagged with
retentionClass='monthly'
will be deleted after 230 days - Blobs tagged with
retentionClass='yearly'
will be deleted after 420 days
- Github Migration archives are automatically deleted after seven days
- Some timings overview
- Approx. 30min to migrate 100 repositories
- 100 repositories with attachements ~= 6GB
You need to generate a Personal Access Token, with all the repo
, and user
permissions.