tuplejump / play-yeoman

Play + Yeoman integration sbt and play plugins
Apache License 2.0
237 stars 58 forks source link

Heroku support? #14

Closed wmill closed 11 years ago

wmill commented 11 years ago

Is it possible to deploy a project using this to Heroku? I can't see any way to build it in a compatible fashion.

milliondreams commented 11 years ago

As I understand, the problem would be that heroku will only provide vanilla sbt and 'grunt' will not be available. So you cannot run grunt there a part of the build.

Also Heroku will just run this command -

sbt clean compile stage

Which will never trigger the grunt task.

I haven't tried it... but this may work.

  1. Run grunt in your local project and checking the grunt dist directory to the deployment repo
  2. Deploy to Heroku

The resources built with grunt should be available.

Let me know if that works, we can add it to documentation.

Also if you are a Heroku user, you can try asking the same to their support or on their mailing list as to what they support? In case we can establish stage to depend on grunt, can they make grunt available in the environment?

wmill commented 11 years ago

Here's what was tripping me up. The default .gitignore for play ignores

dist/

instead of

/dist/

So the ui/dist folder is ignored. Once that was fixed it works with static assets.

raulraja commented 10 years ago

@wmill Once you fix that on .gitignore how are you pushing to Heroku and are you using any custom buildpacks? As I understand Heroku will rebuild all and run 'start' on the built version and since grunt is not available is not going to include all the resources. Furthermore in the next iteration of this plugin once the grunt task is bundled with dist wouldn't the build fail altogether?

wmill commented 10 years ago

@raulraja I'm not actually sure what you mean by custom buildpacks... It was deploying from Jenkins using scripts that delete everything in ui and rebuild ui/dist from another directory.

I don't work at that job anymore so I can't comment on what happens with the next iteration.

fastf0rward commented 9 years ago

I'd like to follow up on this use case. We're trying to push a Play 2.x app with play-yeamon and static assets in the app/ui/dist folder to Heroku. As @raulraja suggests, the 'stage' command that's run from the heroku buildpack triggers grunt, causing the build to fail.

Is there any way to configure play-yeamon to exclude the grunt step in certain use cases? Locally we love the fact that grunt is run automatically every time we run/start the Play app. When deploying to Heroku, however, the app should build with static assets in /app/ui/dist, without triggering grunt.