Skip to content

Commit

Permalink
fix: github backup script (#12)
Browse files Browse the repository at this point in the history
* fix: github backup script

* Update image.yaml

* Update github-backup.sh

* Update github-backup.sh

* Update github-backup.sh

* Update github-backup.sh

* Update README.md
  • Loading branch information
venkatamutyala authored Aug 14, 2023
1 parent f6c4828 commit 049727e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Build, Tag and Push Docker Image to GHCR
uses: GlueOps/github-actions-build-push-containers@v0.1.1
uses: GlueOps/github-actions-build-push-containers@v0.1.3
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export GITHUB_TOKEN="" # GitH needs to have read access to all repositories with
```bash
docker build . -t backup && docker run -it backup
# Export ALL the variables required as mentioned in this README.md and then run:
./github-backup.sh
backup-github
```

# Google Drive Shared Drive Backups
Expand Down
4 changes: 2 additions & 2 deletions github-backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ BACKUP_LOCATION="github.com/$BACKUP_DATE/$GITHUB_ORG_TO_BACKUP"
mkdir -p $BACKUP_LOCATION && cd $BACKUP_LOCATION

for repo in $repos; do
gh repo clone https://github.com/$repo.git -- --mirror
git clone --mirror https://$GITHUB_TOKEN@github.com/$repo.git
repo_name="${repo##*/}"
tar -czf "${repo_name}.tar.gz" "${repo_name}.git" && rm -rf "${repo_name}.git"
done

echo "Uploading everything to S3...."
cd /app
aws s3 cp --recursive github.com/ s3://${S3_BUCKET_NAME}/github.com/
aws s3 cp --recursive github.com/ s3://${S3_BUCKET_NAME}/github.com/

0 comments on commit 049727e

Please sign in to comment.