Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload to staging vs. production? #42

Open
heff opened this issue Apr 24, 2013 · 9 comments
Open

Upload to staging vs. production? #42

heff opened this issue Apr 24, 2013 · 9 comments

Comments

@heff
Copy link

heff commented Apr 24, 2013

If I have two s3 buckets, one for staging and one for production, is there a way to switch between buckets without rewriting the config file each time?

I first tried setting which config to use with --config, but that doesn't appear to be a feature yet.

@adelevie
Copy link
Collaborator

This is an interesting use-case. What kind of API would you desire?

@heff
Copy link
Author

heff commented Apr 24, 2013

My first attempt was to set up something like:

jekyll-s3 --config _jekyll_s3.staging.yml
jekyll-s3 --config _jekyll_s3.production.yml

Then I could create a rake task to run one or the other. I'd be open to other ways to approach it though.

@adelevie
Copy link
Collaborator

I kinda like that. Another approach might be to simply set all of these different params within _jekyll_s3.yml. Would be open to hear what others think.

@heff
Copy link
Author

heff commented Apr 24, 2013

Yeah, if you could do something like

jekyll-s3 --env staging

that could be cool too.

@laurilehmijoki
Copy link
Owner

jekyll-s3 --config _jekyll_s3.production.yml looks tempting.

The --env sounds like a concept that should not be exposed to jekyll-s3, as AWS S3 does not have such a concept.

@bkaid
Copy link

bkaid commented Jun 1, 2013

Being able to specify a --config parameter would be great. My scenario is I upload to two different buckets - js/css/images/etc go to a cloudfront bucket and .html go to a separate non-cloudfront bucket.

@laurilehmijoki
Copy link
Owner

Have you thought about using one bucket and one CloudFront distribution but using two DNS CNAMEs? More precisely, would the following kind of a DNS setup work for you:

CNAME cdn.yourwebsite.net  –> asduem23j12j.cloudfront.net
CNAME yourwebsite.net  –> yourwebsite.net.s3-website-us-east-1.amazonaws.com

Above, the CloudFront distribution would use the yourwebsite.net.s3-website-us-east-1.amazonaws.com bucket as its origin.

(Note that you need to use the AWS Route53 DNS service if you want to point your root domain to an S3 bucket.)

With that kind of a setup you would only need one S3 bucket, which would make things more simple.

Please correct me if I've missed something.

Ps. Being able to specify the jekyll-s3 configuration file with the --config option is anyway a good idea.

@bkaid
Copy link

bkaid commented Jun 2, 2013

@laurilehmijoki Great suggestion - I was over-complicating it. For some reason I thought my CloudFront distribution needed to have a separate bucket but as you mention that is not the case.

@JangoSteve
Copy link

JangoSteve commented Mar 21, 2017

The way I've handled this use-case is to embed ruby in my config file, like this:

s3_bucket: <%= ENV["DEPLOY"] == "production" ? "my_production_bucket" : "my_staging_bucket" %>

Then I can deploy to staging by just running jekyll-s3 push, and I can deploy to production with DEPLOY=production jekyll-s3 push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants