-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Amazon deployment #501
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
Comments
I would find this useful too. @nschurmann would you happen to have an implementation you could put into a PR? |
@JaKXz i don't have an implementation, actually i'm trying to deploy the app into a debian server without any success. |
Have you take a look at this: https://github.com/bevacqua/grunt-ec2? |
@remicastaing looks good, my only doubt is that this lib uses pm2 to keep it running, how you should put this together? |
Absolutely no idea! I just googled it to find if someone else already wrote something to deploy apps with grunt on ec2. |
@JaKXz for now my deployment strategy is mainly using git. |
Of course this is the manual process, an automated process should be a script or command line tool that logins to your amazon ec2 instance, navigate to the folder, make a backup, pull latest changes. And also receive a command that can make a rollback (get into server, navigate to folder, put back the backup). |
I was missing the command that kept the application, after some time googling i found that this:
works quite well. The If you still don't recover the control of the command line just press enter, it should do the trick. |
I haven no ec2/node experience (yet,) but this article describes a method using forever, which is a nice node module for keeping your app alive. There is another one here and more by googling "ec2 node forever" |
@thomporter you know how to use this with servers launched with grunt? |
You won't launch the server with grunt this way. You should only be using grunt to launch your server for development. In production, grunt will just get in the way.. But, I believe this is the core command you'd need:
Let me know if that helps. If not, I might try setting up an ec2 instance myself and see if I can't get the demo project running on it. P.S You'll need to install forever globally first: |
I was able to get our demo app running on an ec2 instance will fairly little hassle... http://ec2-54-68-53-8.us-west-2.compute.amazonaws.com:8080/ I used the Ubuntu ec2 instance.
I also installed mongo, ruby & sass
Then I logged into the server as the app user, and installed NVM:
Next I setup node:
Then I installed yo & forever, and our generator:
Next I built a simple app:
I built it with everything, though I didn't actually setup the passport stuff for 3rd parties, not sure why I even enabled them, but I did. =) Next I setup my environment:
I built the app:
Lastly, I launched it:
The & at the end tells the process to run in the background, so I can log out even and it will keep running. |
Well, but @thomporter you didn't deploy an app on ec2, you build an app from scratch on an ec2 instance. For openshift, the generator help to build an app locally and then help to deploy it on an openshift gear. |
Shouldn't be a problem. Build your app locally and just copy the dist |
Totally loved this. Now i can deploy with forever. 2014-09-04 16:10 GMT-04:00 Thomas Porter [email protected]:
|
You're right. I just compared your recipe (witch is really helpful) with the single I thought what @nschurmann was seeking is to deploy on ec2 in the same way. |
Having a I haven't even looked at the deployment parts of the generator yet, perhaps someone with more experience in that area could chime in? @DaftMonk can you give insight or @ someone who can? =) |
I just looked at grunt-ec2. 👍 @remicastaing This would be an excellent way to add support for ec2 to the generator... |
If anyone has started working on a PR, it would be nice to keep in mind that using BTW, can any Azure users confirm my suggestion? I was honestly spitballing but it should work. |
For what it's worth, the above recipe works great for just distributing the On another note, I'm using the generator to build a project for #hack4good 0.6. I'll send a link once the project is done. If anyone's looking for something to do this weekend, I could use some help writing tests! 😉 Here's some info on the project I'm working on at the moment. If interested, join the event, get into Hipchat and then ping me using |
the main problems why you CAN NOT deploy the
Yes, you always can work around, but isn't this generator created to save time, not to make it harder? |
@mescalito a little harsh there no? I mean, this is free software you're using to help you get a job done. The generator surely helps you generate a well structured, full-stack app (client & server.) It does this incredibly well, and saves you TONS of time, just in boilerplate code alone. For me at least, deployment is just a bonus. Furthermore, you CAN simply copy (scp, ftp, rsync) the Lastly - PRs are accepted. You're more than welcome to help write a deployment scheme for whatever your needs might be, to help improve the generator. |
@mescalito I normally don't comment on rants but I must say you sir, are one ungrateful human being. These guys have been putting time into this for over a year and all you have to say is that this does not meet your exact needs. Really! Show some appreciation and respect for those that have shared their codes, especially when they are some of the best in that field. |
I did my own recipe, I even a video:
you can avoid the first 13 minutes setting up and go direct to the important part: Deploy AngularJS into Amazon EC2 - From start to end.
😁 😁 Now everything is working, Open your browser on your IP address 😁
✒️
Now make a new commit and everything should work automatically. And there you have a deployment workflow for to Deploy AngularJS into Amazon EC2 using Yeoman Angular-Fullstack Generator In general I do not like the workflow used by the Angular-Fullstack because deploying is extremely complicated due to the ENV variables 😡. Also the Grunt.js file provided by the Angular-Fullstack Generator should have meaningful comments 😡. Why is so poor documented due to the fact that is the most critical piece on the generator? |
Awesome @mescalito |
sucks !!! |
@mescalito you rock! |
@mescalito there's a lot of really useful stuff in your recipe. One possible issue - if you are binding the NODE_ENV setting to when git commits from the client (which stops and restarts forever process manager), what happens if the server restarts for a different reason? Presumably the production env would not get passed... This link is quite handy Btw I'm not crazy about the lack of comments in the angular-fullstack Gruntfile but it is still a great free resource. |
Yes, .bash_profile solution :) |
I have some problem. |
@victorhugoviiii That's because any running process will close once you close a terminal session. Using something like |
You can use pm2 too. It has many more features. |
thanks @mescalito I used most of your recipe to deploy on AWS EC2 . I also got a mongo DB working I'll share a couple things that I worked through :
IF you followed 3 and set NODE_ENV to production you'll avoid npm install intalling all of dev dependencies avoiding much of - Dependencies unmet: I had hundreds of warnings I believe due to my initial attempts to compile via grunt instead of using the mescalitos technique of pushing dist. note: node comes with an old npm version and 'npm update' doesn't update it. You should google around but worked for me was 'sudo npm install -g forever' TWICE first time didn't do it. http://askubuntu.com/questions/562417/how-do-you-update-npm-to-the-latest-version again might be a better more current way for that. Note 2: AWS ec2 instances evidently go awry with some frequency. I spoke to a AWS support person at their pop-up loft in SF and he advised me that a very very early thing to try when things start working is to launch a new EC2 instance and try your code on that before assuming your code is at fault. "is the cord plugged in" debugging almost. I wasted a couple weeks looking for issues with my passport-facebook and passport-twitter ouath which went away after I launched a new ec2 instance. |
@mescalito thank you for your comments. I'm a macosx user and had to do few changes as also tom suggested
then updating the git config files file as below
|
I know this issue is quite old now and there has been some good input already on deploying to AWS, but in case anyone is interested, here's a guide I put together for my team detailing the steps needed to take an Angular Fullstack app from development to production using AWS OpsWorks. https://gist.github.com/duncan-p/8b8df883babf65c0350a6c2553d864ab I know this differs from Heroku/Openshift deployment in that it doesn't push directly to your production servers, but I'm a huge fan of OpsWorks and since I started using it a year or so ago, I haven't looked back. |
Is there a plan to build a command line that deploys and rollbacks to amazon web services?, that would be super useful.
The text was updated successfully, but these errors were encountered: