mirror of
https://github.com/stronk-dev/RandomChad.git
synced 2025-07-05 10:35:08 +02:00
✨ add offline backup script
This commit is contained in:
parent
0822003795
commit
624b660f3b
14
.github/workflows/deploy-functions.yml
vendored
14
.github/workflows/deploy-functions.yml
vendored
@ -50,20 +50,6 @@ jobs:
|
|||||||
echo "Project is now set to ${{ secrets.FIREBASE_PROJECT_ID_PRODUCTION }}"
|
echo "Project is now set to ${{ secrets.FIREBASE_PROJECT_ID_PRODUCTION }}"
|
||||||
gcloud firestore export ${{ secrets.GCP_BUCKET_LINK_PRODUCTION }}/firestore-backups/$(date +'%Y-%m-%d-%s')/
|
gcloud firestore export ${{ secrets.GCP_BUCKET_LINK_PRODUCTION }}/firestore-backups/$(date +'%Y-%m-%d-%s')/
|
||||||
|
|
||||||
- name: Backup Rocketeer storage
|
|
||||||
run: |
|
|
||||||
mkdir rocketeer-image-backups
|
|
||||||
gcloud config set project ${{ secrets.FIREBASE_PROJECT_ID_PRODUCTION }}
|
|
||||||
echo "Project is now set to ${{ secrets.FIREBASE_PROJECT_ID_PRODUCTION }}"
|
|
||||||
gcloud -m cp -r ${{ secrets.GCP_BUCKET_LINK_PRODUCTION }}/mainnetRocketeers ./rocketeer-image-backups/
|
|
||||||
gzip -r -v -9 ./rocketeer-image-backups/
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: rocketeer-image-backup.gz
|
|
||||||
path: ./rocketeer-image-backups.gz
|
|
||||||
|
|
||||||
|
|
||||||
- name: Deploy to Firebase
|
- name: Deploy to Firebase
|
||||||
uses: w9jds/firebase-action@master
|
uses: w9jds/firebase-action@master
|
||||||
with:
|
with:
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@ node_modules
|
|||||||
build/
|
build/
|
||||||
docs/
|
docs/
|
||||||
*.log
|
*.log
|
||||||
|
.backups
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
"test": "test"
|
"test": "test"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"backup": "zsh ./scripts/backup-images.zsh"
|
||||||
},
|
},
|
||||||
"author": "Mentor Palokaj <mentor@palokaj.co> (http://github.com/actuallymentor)",
|
"author": "Mentor Palokaj <mentor@palokaj.co> (http://github.com/actuallymentor)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
14
scripts/backup-images.zsh
Normal file
14
scripts/backup-images.zsh
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
## ###############
|
||||||
|
## Manual image backup
|
||||||
|
## I intend to make this an online thing
|
||||||
|
## But the storage cost is a bit expensive
|
||||||
|
## ###############
|
||||||
|
timestamp=$( date )
|
||||||
|
cd .backups && \
|
||||||
|
gcloud config set project rocketeer-nft && \
|
||||||
|
gsutil -m cp -r gs://rocketeer-nft.appspot.com/mainnetRocketeers/ ./rocketeer-image-backups/ && \
|
||||||
|
tar -cv rocketeer-image-backups | gzip -9 > rocketeer-backup-$timestamp.tar.gz && \
|
||||||
|
mv rocketeer-backup-$timestamp.tar.gz ~/Google\ Drive/Backup/Rocketeers/
|
||||||
|
echo "✅ success" || echo "🛑 fail"
|
||||||
|
|
||||||
|
say "Backup process done"
|
Loading…
x
Reference in New Issue
Block a user