Sign inSign up

uoacer/research-hub-web

By uoacer

•Updated over 8 years ago

Automated build for research-hub-web

Image
0

596

uoacer/research-hub-web repository overview

⁠ResearchHub

⁠Development

This section explains how to develop code for the Research Hub.

⁠Environment setup

Install Node 4⁠ or higher with NPM 3 or higher.

Install angular-cli

npm install -g angular-cli
⁠Development server

Navigate to project directory, e.g:

cd ~/workspace/research-hub

Update dependencies:

npm install

Run npm start for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

⁠Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive/pipe/service/class.

⁠Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the -prod flag for a production build.

⁠Running unit tests

Run ng test to execute the unit tests via Karma⁠.

⁠Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor⁠. Before running the tests make sure you are serving the app via ng serve.

⁠Further help

To get more help on the angular-cli use ng --help or go check out the Angular-CLI README⁠.

⁠Deployment

This section explains how to deploy the Research Hub to production.

⁠Deploying to Github Pages

Run ng github-pages:deploy to deploy to Github Pages.

⁠Deploying to the Research Hub server

The Research Hub is build with the angular-cli and hosted on an Apache Http server in a Docker container.

⁠Prerequisites

Install Docker by following these instructions⁠.

⁠Deployment
  • Production and staging containers are automatically built on Docker Hub⁠.
  • Watchtower⁠ is used to automatically update staging and production when new images are built.
  • To deploy a new production version of the Research Hub, update the production tag name on uoacer/research-hub⁠.
  • To deploy a new staging version of the Research Hub, commit to the staging branch.

Setup the running docker containers with the following commands:

sudo su -
docker run -d --name watchtower -v /var/run/docker.sock:/var/run/docker.sock centurylink/watchtower --cleanup
docker run --restart=always -p 80:80 -p 443:443 -v /research-hub:/usr/local/apache2/conf/keys -d uoacer/research-hub:production
docker run --restart=always -p 8080:443 -v /research-hub:/usr/local/apache2/conf/keys -d uoacer/research-hub:staging

Tag summary

Content type

Image

Digest

Size

289.1 MB

Last updated

over 8 years ago

docker pull uoacer/research-hub-web:production