Docker image that uses Python to backup all projects in a Gitlab group to ZIP files.
293
Docker image that uses Python to backup all projects in a Gitlab group to ZIP files. You simply configure the group id and access token and this image will download all repositories to separate zip files.
For simplicity, it will save all files into a single directory, using the full path of the group structure to name the files. The container assumes the volume mapping to a /data directory within the container that should be mapped at runtime.
Note: This process only archives the file content of the repository and does not backup full commit history, issues, or other content within the repository.
The image can be run by passing an environment variable file to docker run.
$ docker run -ti --rm --name gitlab-backup --env-file ./env.list -v /your/local/directory:/data cscheide/gitlab-group-projects-backup:latest
There is a sample.env file contained within the Github project for you to reference if needed.
Alternatively, the environment variables can be passed in via the -e flag.
$ docker run -ti --rm --name gitlab-backup -e "GITLAB_TOKEN=your_gitlab_token" -e "GITLAB_GROUP_ID=000000" -e "BACKUP_ARCHIVED=yes" -v /your/local/directory:/data cscheide/gitlab-group-projects-backup:latest
This container utilizes environment variables for configuration. The following shows the required and optional environment variables
The following environment variables are minimally required in order for the container to work properly:
GITLAB_TOKEN : The Gitlab access token of a user who has access to the groupGITLAB_GROUP_ID : The ID of the Gitlab group to back backed upIn addition, the container supports the optional configurations:
BACKUP_ARCHIVED : If this variable is set to yes, repositories that are archived will also be backed up.The container will write the backup ZIP files to the /data directory within the container. In most cases, you will want to map this directory to a local file directory to keep the backups.
If you have any problems with or questions about this image, please post a GitHub issue.
This started out as a project for a particular issue that I had. However, anyone is invited to contribute new features, fixes, or updates, large or small; I will be happy to receive any ideas on how to make this better. Please feel free to fork or submit pull requests.
Before you start to tackle a new issue, please discuss your plans through a GitHub issue, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
Content type
Image
Digest
sha256:b9bc4031f…
Size
23.7 MB
Last updated
over 3 years ago
docker pull cscheide/gitlab-group-projects-backup