Dump GitHub repo tarballs directly to S3.
8.7K
rclone/rclone to support backing up multiple repos in series.$ docker pull jdrydn/github-to-s3:latest
$ docker run \
-e GITHUB_TOKEN=your-github-token \
-e S3_BUCKET=project-backups \
jdrydn/github-to-s3:latest \
jdrydn/Dockerfiles jdrydn/yoem
ACTION: Downloading jdrydn/Dockerfiles to s3:project-backups/20191012T131547Z-jdrydn-Dockerfiles.tar.gz
ACTION: Downloading jdrydn/yoem to s3:project-backups/20191012T131547Z-jdrydn-yoem.tar.gz
SUCCESS!
To configure this script or rclone, pass environment variables at runtime:
| Variable | Default | Description |
|---|---|---|
GITHUB_TOKEN | Optional, but required if you want to fetch a private repo | |
S3_BUCKET | Required, specify the destination S3 bucket to save the backup to | |
S3_PREFIX | (none) | Optionally specify the destination S3 prefix to save the backup to |
S3_FILENAME | %Y%m%dT%H%M%SZ | Optionally specify the file prefix for the S3 file, using date |
Pass a list of all the repositories you want to be backed up to the Docker CMD. Files will be named $S3_PREFIX$S3_FILENAME-$REPO.tar.gz.
You can configure other variables too, such as the AWS region, using RCLONE_CONFIG_S3_REGION and other env vars.
You could even use this image to backup GitHub repositories to an S3-compatible source, such as DigitalOcean or Minio, by using the RCLONE_CONFIG_S3_ variables to set relevant endpoints etc.
$ docker run --rm \
--env-file ./backup.env \
jdrydn/github-to-s3:latest
jdrydn/yoem
$ docker run --rm \
-e GITHUB_TOKEN=your-github-token \
-e S3_BUCKET=project-backups \
jdrydn/github-to-s3:latest \
jdrydn/yoem
S3::putObject permissions to your target bucket.jdrydn/github-to-s3:latestGITHUB_TOKEN values in sync with your application, or similar.$ aws ecs run-task \
--cluster default \
--task-definition database-backup \
--launch-type FARGATE \
--network-configuration 'awsvpcConfiguration={subnets=[A,B,C],securityGroups=[D],assignPublicIp=ENABLED}'
A,B,C & D.$ docker build -t jdrydn/github-to-s3:dev .
$ cat << EOF >> .env
GITHUB_TOKEN=your-github-token
S3_BUCKET=backup-bucket
S3_PREFIX=codebase-backups-dev/
EOF
$ docker run --rm -it --network=host \
-v ~/.aws/credentials:/root/.aws/credentials:ro \
--env-file ./.env \
jdrydn/github-to-s3:dev \
jdrydn/Dockerfiles
Content type
Image
Digest
sha256:02fc46420…
Size
19.9 MB
Last updated
over 3 years ago
docker pull jdrydn/github-to-s3