简体   繁体   中英

How to Deploy and Run an Angular-CLI to AWS EC2 with Jenkins

Here's where I stand right now:

  1. Angular2 codebase is currently in Bitbucket
  2. Jenkins build is to bring in the codebase, run an "ng build" to get the /dist folder built correctly.
  3. deploy only the /dist folder contents to the server

From here, I'm very confused as to what to do to actually run the front-end code. When doing local development, I simply do "ng serve" from the project root directory, and that handles everything. Is this still how I run the project from the server after moving the /dist artifacts over? Angular-CLI documentation is extremely lacking in this aspect, as the only given way to deploy code currently is to use github-pages, which is not something I want to have to do.

Anyone able to give me some guidance or documentation that helps me figure out what I'm trying to do?

Once you build the project, and copy the contents of the "dist" directory, you need a web server to server the index.html and the Angular2 JavaScript. If you are running a Windows instance on EC2, you need to install IIS. Or on Linux, Apache. You need to have those files in a directory accessible from the web server, and that's it. Running "ng serve" locally provides the functionality of a web server through NodeJs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM