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

Frontend gulp task to publish to S3 #18

Open
mjzone opened this issue Oct 5, 2016 · 5 comments
Open

Frontend gulp task to publish to S3 #18

mjzone opened this issue Oct 5, 2016 · 5 comments

Comments

@mjzone
Copy link
Collaborator

mjzone commented Oct 5, 2016

No description provided.

@mjzone mjzone added this to the React front-end automation milestone Oct 18, 2016
@mhrisse
Copy link

mhrisse commented Oct 20, 2016

Hi! We would like to help. How about using https://github.com/pgherveou/gulp-awspublish ?

@mjzone
Copy link
Collaborator Author

mjzone commented Oct 20, 2016

Sure. That plugin looks good. Go ahead @mhrisse 🎇

@mhrisse
Copy link

mhrisse commented Oct 20, 2016

Hi! There is also https://github.com/serverless/serverless-client-s3 which is on the original serverless repo, but does not work with v1.0 properly yet. It looks very simple, maybe the way to go? @mjzone

@mjzone
Copy link
Collaborator Author

mjzone commented Oct 20, 2016

@mhrisse Since it is not properly supported let's go with gulp-awspublish.
It's great if we could write a gulp task accepting APIG uri as a parameter and replace the BASE_URL in the react app and then do the bundling and upload to S3.
As the next step of automation, we can configure cloudfront to avoid cross origin requests and have a relative base url for the client. Then we can use a proxy such that we don't have to change api urls between development and production.

@jcummins54
Copy link
Collaborator

jcummins54 commented Nov 22, 2016

If you check my edited gulpfile, https://github.com/99xt/serverless-react-boilerplate/blob/react-authenticate/gulpfile.js, I added a couple very simple tasks that webpack the app and sync to an s3 bucket using the AWS CLI. See tasks deploy-web, build-web, and sync-web-s3

It copies a webpack.[stage].config.js to webpack.config.js first so you can set up a different config for each environment.

What I haven't done yet is create a way to change s3 buckets per stage, a simple conditional would suffice, but having point to env variables would be more elegant.

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

3 participants