brandonweiss / discharge

⚡️ A simple, easy way to deploy static websites to Amazon S3.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Options for uploading to existing bucket?

jewbetcha opened this issue · comments

I'm looking for a way to streamline deployment to an existing S3 bucket, is that possible with discharge? I've already set up DNS for the bucket so it'd be great to keep using it.

Thank you!

Yep! It should work just fine. 😃

After you create your config and try to deploy, a few things will happen. It will try an create the bucket, but since it already exists it will skip that step. Then it will try and update the bucket configuration with whatever is in your config, so make sure you’ve replicated the existing bucket config in your Discharge config. Then it will synchronize your website, which should do absolutely nothing if you’re building your static files the same way and using the same “trailing slashes” setting.

If you’re extra paranoid you should backup the files in your bucket first. I’m not sure how you were uploading files before, but sometimes when people are doing it manually they wind up with files in the bucket that are being used but aren’t represented locally. Discharge would wind up removing those files when syncing, but you can retrieve them from your backup if that happens.

Let me know how it goes!

Okay nice! Thanks 😄

So my bucket URL == domain in the config?

Ah, no, the domain is what is used as your bucket name! It’s OK if the current bucket name isn’t literally a domain. I just called it “domain” to sort of simplify the naming of the bucket and ensure it’s URL-safe, rather than having to come up with an arbitrary name.