Push/Pull using S3
Make sure you've set up your local machine to access your AWS account by setting up your credentials.
This section will teach you:
Local and remote contexts
Committing and pushing bundles to S3
Pulling bundles from S3
The difference between localized (w/ files) and non-localized (files remain on S3) bundles
Set up a remote for your local context:
local context: A Disdat-managed directory on your dev box (typically at
~/.disdat/context
) that holds bundles.remote context: A Disdat-managed directory on S3. A remote consists of the remote context as well as the
s3://<bucket>/<optional_key>
that your Disdat project uses to store all of its contexts.
Switch to our examples context:
dsdt switch examples
Add the remote
dsdt remote -f <remote context name> <s3 bucket/key where you want contexts to go>
Note: The-f
flag is used to force a context to be bound to a new remote.List the contexts
dsdt context
Commit and push your bundle to S3:
Yay! You're bundle is now safely on S3. Let's delete it and restore it!
Alternatively another user could bind their local context to this remote and pull the bundle as well.
And nothing remains in our local context:
Restore it by pulling all the remote bundles:
Check to see our bundle made it back:
Our bundle is restored! Let's look at it:
Oh no, the bundle contains an S3 path! When we made it, it contained a path to the file on local disk. This is because the bundle has not been localized. By default Disdat only moves meta-data when pushing/pulling to/from remotes. But if you want to look at the data directly, one must localize the bundle. That is, pull down copies of the files as well as the bundle's meta data.
Localize the bundle to get a local copy of the files it contains:
Now we have created a local copy of the bundle on S3. That bundle on S3 is still there, by the way.
Last updated
Was this helpful?