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

Use a rails application template for Heroku + example-app #3206

Conversation

elia
Copy link
Member

@elia elia commented May 10, 2019

Description

The current heroku deploy button is partially broken and uses a custom buildpack.
This PR introduces a reusable rails application template that can be used to generate and update a demo-app (presumably published at https://github.com/solidusio/solidus-example-app).

The app will have its own app.json and will be a good base for deploys to heroku, but also
for forks. Heroku deploys should be already on the right path for production use (cache, images, etc.)

The template can also be used as an executable to build the official demo app:

~/Code/solidus $ cd ..
# the default APP_NAME is solidus-example-app
~/Code $ solidus/bin/rails-application-template [APP_NAME]
# …generates the app…

Demo app

The resulting code is available here: https://github.com/nebulab/solidus-example-app
I just had to change the heroku button url to point at the nebulab org instead of solidusio, other than that it's straight out of the template.

See it in action: https://elia-solidus-demo.herokuapp.com

Screenshots

image

image

image

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have updated Guides and README accordingly to this change (if needed)
  • I have added tests to cover this change (if needed)

@elia elia force-pushed the elia/solidus-example-app-and-rails-application-template branch from 5a41959 to 7318598 Compare May 17, 2019 15:22
@elia elia marked this pull request as ready for review May 17, 2019 15:40
Copy link
Contributor

@ericsaupe ericsaupe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. This does make some assumptions as to services like Cloudinary and Memcachier but since this is meant as an example app I think those are fine choices that are easily changed by the user.

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Copy link
Contributor

@jacobherrington jacobherrington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking, just a small typo.

I think this is a fine option. Thanks for the work @elia!

bin/rails-application-template Outdated Show resolved Hide resolved

if ENV['UPDATE_EXAMPLE_APP_REPO']
git remote: %{ add origin [email protected]:solidusio/solidus-example-app.git }
git push: %{ --force --set-upstream origin master }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure about using --force here without asking the user for confirmation, but I talked myself into being okay with it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is to have something that can be automated and requires as few interaction as possible. That's only for the chore of updating the example app after a release of course, it doesn't happen when used as an app template.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and worst case scenario we just regenerate the example app. The repo we are pushing to will not contain anything we would be afraid to lose.

@elia
Copy link
Member Author

elia commented May 29, 2019

Looks good to me. This does make some assumptions as to services like Cloudinary and Memcachier but since this is meant as an example app I think those are fine choices that are easily changed by the user.

Yes, given it's going to be deployed on heroku I looked for services that had a free tier and were at the same time viable for production use (using a cache and a CDN are both very good practices for any production store).

@elia elia force-pushed the elia/solidus-example-app-and-rails-application-template branch 2 times, most recently from f201121 to f0d7783 Compare May 29, 2019 14:46
@kennyadsl
Copy link
Member

@elia I moved the repo from nebulab org to solidusio: https://github.com/solidusio/solidus-example-app

Are we good to go?

@elia
Copy link
Member Author

elia commented May 31, 2019

Are we good to go?

I'll remove the last commit and we're good! 🚀

The app template should be used to regularly generate a Rails app which will
have its own app.json and will be a good base to deploy to heroku, but also
to fork download to start a solidus store.
@elia elia force-pushed the elia/solidus-example-app-and-rails-application-template branch from f0d7783 to 698f1f8 Compare May 31, 2019 08:19
@elia
Copy link
Member Author

elia commented May 31, 2019

@kennyadsl done, and also regenerated the app to with the solidusio heroku button link 👍

@kennyadsl kennyadsl merged commit 8f3ea04 into solidusio:master May 31, 2019
@kennyadsl kennyadsl deleted the elia/solidus-example-app-and-rails-application-template branch May 31, 2019 11:44
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

Successfully merging this pull request may close these issues.

None yet

5 participants