angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.13k stars 1.24k forks source link

Heroku deployment and git repo #1950

Open AmirGilboa opened 8 years ago

AmirGilboa commented 8 years ago

Apologies for another newbie question. I want to deploy to heroku, and i read that it's all based on git repo. Just as you have your github or bitbucket "remote" (central storage), you define a new one that is heroku. and you are basically pushing your code, instead of to your regular remote, to the newly created heroku remote. That is all good, but i don't really want all my code to travel to the production server. I only want the 'dist' folder, the complied, transpiled, minified, etc, to be copied to the server. How to achieve that? Do i have to manage another git repo just for deployment? How do i make sure the 2 repos will not mix and confuse each other?

Awk34 commented 8 years ago

IIRC the code that gets pushed to Heroku is only the prod code. Check with the repo that's created in /dist

AmirGilboa commented 8 years ago

great. the command yo angular-fullstack:heroku should be run at the root, or in the dist folder? what is the expected outcome? it only asks me for a name, and then returns without any noticeable change.

and please allow me to ask again, this is critical: are we dealing with 2 different repositories here? one for our day to day source control, and one for heroku deployment? or is it one?

thanks.

Awk34 commented 8 years ago

It should be run from the root. ls -lah dist to be sure it worked.

I don't use Heroku, but if my memory serves me correctly yes, there's a different git repo created for the code that goes to heroku

AmirGilboa commented 8 years ago

Thanks. Nothing actually happens when i run this command in the root. it is asking for a name to deploy as (leave blank for random name), and returns as if nothing happened. no git repo created or any other change. maybe i should manually create the repo, and the generator will only check in to it? Where is the code that is being activated? should be in the gruntfile, right?

Awk34 commented 8 years ago

https://github.com/angular-fullstack/generator-angular-fullstack/blob/master/src/generators/heroku/index.js

What happens if you give it a name?

djpark commented 8 years ago

If you want to deploy to heroku, 1) build your project then 2) run the buildcontrol command from your /dist folder:

grunt buildcontrol:heroku

Make sure that your git remote is set appropriately in your /dist folder. You can check with git remote -v

bestconsultant commented 8 years ago

@djpark Before that you need to run yo angular-fullstack:heroku and that's where it's not working. I'm getting the following (and not useful) message : (!) NamedBase constructor is deprecated. See https://github.com/yeoman/generator/issues/882

bestconsultant commented 8 years ago

@Awk34 It doesn't work either when you give it a name.

bestconsultant commented 8 years ago

My solution #1966