Skip to content

Commit

Permalink
inserted, examples witj --tarball and --sync subparameter to usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
frekele committed Apr 24, 2016
1 parent 40f5c2f commit 10901ea
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 19 deletions.
53 changes: 39 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
### Usage:

```
docker run -d [Environment Variables] [-v|--volumes-from] frekele/helicopterizer [backup|restore]
docker run -d [Environment Variables] [-v|--volumes-from] frekele/helicopterizer [backup|restore] [--tarball|--sync]
```


Expand Down Expand Up @@ -90,20 +90,43 @@ us-gov-west-1 | US GovCloud West (Oregon) |

### Usage Examples:

Run Backup:
Run Backup with tarball:
```
docker run --rm \
-e STORAGE_PROVIDER=AWS \
-e AWS_ACCESS_KEY_ID=XXXXXXXXXXXXX \
-e AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
-e AWS_S3_BUCKET_NAME=s3://my-bucket-backup/ \
-v /home/jenkins-data:/data:ro \
helicopterizer backup
helicopterizer backup --tarball
```

Run Backup with sync filesystem:
```
docker run --rm \
-e STORAGE_PROVIDER=AWS \
-e AWS_ACCESS_KEY_ID=XXXXXXXXXXXXX \
-e AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
-e AWS_S3_BUCKET_NAME=s3://my-bucket-backup/ \
-v /home/jenkins-data:/data:ro \
helicopterizer backup --sync
```

*Use ':ro' to mount the volumes in read-only mode.*

Run Restore:
Run Restore with tarball:
```
docker run --rm \
-e STORAGE_PROVIDER=AWS \
-e AWS_ACCESS_KEY_ID=XXXXXXXXXXXXX \
-e AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
-e AWS_S3_BUCKET_NAME=s3://my-bucket-backup/ \
-e BACKUP_VERSION=2016-04-17T00:34:20Z \
-v /home/jenkins-data:/data:rw \
helicopterizer restore --tarball
```

Run Restore with sync filesystem:
```
docker run --rm \
-e STORAGE_PROVIDER=AWS \
Expand All @@ -112,8 +135,9 @@ docker run --rm \
-e AWS_S3_BUCKET_NAME=s3://my-bucket-backup/ \
-e BACKUP_VERSION=2016-04-17T00:34:20Z \
-v /home/jenkins-data:/data:rw \
helicopterizer restore
helicopterizer restore --sync
```

*Use ':rw' to mount the volumes in read-write mode.*


Expand All @@ -134,12 +158,13 @@ AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AWS_S3_BUCKET_NAME=s3://my-bucket-backup/
AWS_S3_PATH=/
AWS_DEFAULT_REGION=us-east-1
AWS_S3_OPTIONS=--delete
##################################
.
docker run --rm \
--env-file ~/helicopterizer.conf \
-v /home/jenkins-data:/data \
helicopterizer [backup|restore]
helicopterizer [backup|restore] [--tarball|--sync]
```

Run [Backup|Restore] with data volume container:
Expand All @@ -148,7 +173,7 @@ docker run --rm \
........
-e DATA_PATH=/var/jenkins_home/ \
--volumes-from jenkins-data \
helicopterizer [backup|restore]
helicopterizer [backup|restore] [--tarball|--sync]
```

Run [Backup|Restore] with Cron Job Scheduler (System Timezone is UTC):
Expand All @@ -157,7 +182,7 @@ Run [Backup|Restore] with Cron Job Scheduler (System Timezone is UTC):
docker run -d \
........
-e CRON_SCHEDULE='30 4 * * *' \
helicopterizer [backup|restore]
helicopterizer [backup|restore] [--tarball|--sync]
#####################################################
######### Examples Cron Job Scheduler Usage #########
Expand Down Expand Up @@ -185,15 +210,15 @@ Run [Backup|Restore] with prefix name *$(BACKUP_NAME)-$(BACKUP_VERSION).tar.gz*:
docker run --rm \
........
-e BACKUP_NAME=my-backup-name \
helicopterizer [backup|restore]
helicopterizer [backup|restore] --tarball
```

Run [Backup|Restore] without gzip compression:
```
docker run --rm \
........
-e GZIP_COMPRESSION=false \
helicopterizer [backup|restore]
helicopterizer [backup|restore] --tarball
```

Run With clean the date before the restore:
Expand All @@ -203,7 +228,7 @@ Run With clean the date before the restore:
docker run --rm \
........
-e CLEAN_DATA_BEFORE_RESTORE=true \
helicopterizer restore
helicopterizer restore [--tarball|--sync]
```

Run [Backup|Restore] with other data path:
Expand All @@ -212,23 +237,23 @@ docker run --rm \
........
-e DATA_PATH=/other-data-directory/ \
-v /home/jenkins-data:/jenkins-data \
helicopterizer [backup|restore]
helicopterizer [backup|restore] [--tarball|--sync]
```

Run [Backup|Restore] with other AWS Region:
```
docker run --rm \
........
-e AWS_DEFAULT_REGION=sa-east-1 \
helicopterizer [backup|restore]
helicopterizer [backup|restore] [--tarball|--sync]
```

Run [Backup|Restore] with subdirectories in AWS S3:
```
docker run --rm \
........
-e AWS_S3_PATH=/project-alpha/nexus/ \
helicopterizer [backup|restore]
helicopterizer [backup|restore] [--tarball|--sync]
```


Expand Down
3 changes: 0 additions & 3 deletions scripts/core/sync/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ echo "Starting Sync Backup to ${STORAGE_PROVIDER^^} ..."
. /scripts/provider/${STORAGE_PROVIDER,,}/sync/upload.sh


#TODO


#Call Upload Provider.
uploadResult=$(uploadSync)

Expand Down
4 changes: 2 additions & 2 deletions scripts/core/sync/restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ echo "Starting Sync Restore From ${STORAGE_PROVIDER^^} ..."
. /scripts/provider/${STORAGE_PROVIDER,,}/sync/download.sh


#TODO

#Clean data before restore Only flag CLEAN_DATA_BEFORE_RESTORE equals true.
cleanDataBeforeRestore $CLEAN_DATA_BEFORE_RESTORE

#Call Download Provider.
downloadResult=$(downloadSync)
Expand Down

0 comments on commit 10901ea

Please sign in to comment.