@@ -96,29 +96,36 @@ tasks:
9696 fi
9797
9898 download :
99- desc : Downloads a snaplet snapshot from a given S3 Bucket. Pass in SNAPSHOT_NAME to download a specific snapshot from the bucket.
99+ desc : Downloads a snaplet snapshot to the local machine.
100+ summary : |
101+ Downloads a given snaplet snapshot from a given S3 Bucket.
102+ Pass in RESTORE_SNAPSHOT to download a specific snapshot from the bucket.
103+ Pass in SNAPSHOT_ENV to download the snapshot for a specific environment.
104+ Pass in SNAPLET_BUCKET to download from a specific bucket.
100105 silent : true
101106 deps :
102- - clean
103- - validate-snaplet-bucket-access
107+ - task : clean
108+ vars :
109+ SNAPSHOT_PATH : " {{.SNAPSHOT_PATH}}"
110+ - task : validate-snaplet-bucket-access
104111 vars :
105- SNAPSHOT_NAME : ' {{.SNAPSHOT_NAME | default "latest"}}'
106- SNAPSHOT_PATH : " .snaplet/snapshots/{{.SNAPSHOT_ENV}}/{{.SNAPSHOT_NAME }}"
112+ RESTORE_SNAPSHOT : ' {{.RESTORE_SNAPSHOT | default "latest"}}'
113+ SNAPSHOT_PATH : " .snaplet/snapshots/{{.SNAPSHOT_ENV}}/{{.RESTORE_SNAPSHOT }}"
107114 requires :
108115 vars :
109116 - SNAPLET_BUCKET
110117 - SNAPSHOT_ENV
111118 cmds :
112- - aws s3 cp --quiet --sse=AES256 --recursive {{.SNAPLET_BUCKET}}/{{.SNAPSHOT_ENV}}/{{.SNAPSHOT_NAME }} {{.SNAPSHOT_PATH}}
113- - printf "\n\n⬇ Snapshot downloaded to {{.SNAPSHOT_PATH}}"
119+ - aws s3 cp --quiet --sse=AES256 --recursive {{.SNAPLET_BUCKET}}/{{.SNAPSHOT_ENV}}/{{.RESTORE_SNAPSHOT }} {{.SNAPSHOT_PATH}}
120+ - printf "\n\n⬇ Snapshot downloaded to {{.SNAPSHOT_PATH}}\n\n "
114121
115122 restore :
116- desc : Restores the given SNAPSHOT_NAME to the SNAPLET_TARGET_DATABASE_URL database.
123+ desc : Restores the given RESTORE_SNAPSHOT to the SNAPLET_TARGET_DATABASE_URL database.
117124 prompt : This will wipe all of the data in the given SNAPLET_TARGET_DATABASE_URL. Are you sure?
118125 silent : true
119126 vars :
120- SNAPSHOT_NAME : ' {{.SNAPSHOT_NAME | default "latest"}}'
121- SNAPSHOT_PATH : .snaplet/snapshots/{{.SNAPSHOT_ENV}}/{{.SNAPSHOT_NAME }}
127+ RESTORE_SNAPSHOT : ' {{.RESTORE_SNAPSHOT | default "latest"}}'
128+ SNAPSHOT_PATH : .snaplet/snapshots/{{.SNAPSHOT_ENV}}/{{.RESTORE_SNAPSHOT }}
122129 requires :
123130 vars :
124131 - SNAPLET_TARGET_DATABASE_URL
0 commit comments