angular-hello-world
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dev-setup add next dev-setup config for v0.5.0-c1-@ Jul 17, 2017
dist @ #30 | minor updates for teracy-dev best practices Mar 20, 2017
docs @ #7 | should use dev Docker service name for all angular related tasks Feb 1, 2017
e2e @ #28 | should upgrade to @angular/cli v1.0.0-rc.2 Mar 20, 2017
node_modules add missing node_modules directory Jul 12, 2017
src @ #28 | should upgrade to @angular/cli v1.0.0-rc.2 Mar 20, 2017
.angular-cli.json init project from teracy/angular-boilerplate repo Mar 20, 2017
.angular-cli.tpl.json @ #28 | should upgrade to @angular/cli v1.0.0-rc.2 Mar 20, 2017
.editorconfig @ #7 | should use dev Docker service name for all angular related tasks Feb 1, 2017
.env.example get this work with gitlab-ci Apr 4, 2017
.gitignore add missing node_modules directory Jul 12, 2017
.gitlab-ci.yml get this work with gitlab-ci Apr 4, 2017
.travis.yml get this work with gitlab-ci Apr 4, 2017
Dockerfile get this work with gitlab-ci Apr 4, 2017
LICENSE update README with getting started section, add LICENSE file Sep 22, 2016
README.md get this work with gitlab-ci Apr 4, 2017
docker-compose.prod.tpl.yml @ #30 | bug fix for container_name of prod service Mar 20, 2017
docker-compose.prod.yml get this work with gitlab-ci Apr 4, 2017
docker-compose.review.yml update to match with acme-dev (acme101) best practices Mar 21, 2017
docker-compose.tpl.yml @ #30 | minor updates for teracy-dev best practices Mar 20, 2017
docker-compose.yml get this work with gitlab-ci Apr 4, 2017
dockerignore @ #7 | should use dev Docker service name for all angular related tasks Feb 1, 2017
karma.conf.js @ #28 | should upgrade to @angular/cli v1.0.0-rc.2 Mar 20, 2017
package.json update to match with acme-dev (acme101) best practices Mar 21, 2017
package.tpl.json @ #31 | should use domain aliases for dev and prod modes instead of p… Mar 20, 2017
protractor.conf.js @ #28 | fix for the right format style of protractor.conf.js Mar 20, 2017
run-dev.sh get this work with gitlab-ci Apr 4, 2017
setup.sh @ #30 | minor updates for teracy-dev best practices Mar 20, 2017
tslint.json @ #28 | should upgrade to @angular/cli v1.0.0-rc.2 Mar 20, 2017
yarn.lock init project from teracy/angular-boilerplate repo Mar 20, 2017

README.md

angular-hello-world Build Status build status

This project was created from angular-boilerplate version 0.2.0.

Getting started

Follow: https://github.com/acme101/dev-setup/blob/master/README.md

Generate node_modules

Usually, we need node_modules to check out the used source code of dependencies.

Use this:

$ cd ~/acme-dev
$ vagrant ssh
$ ahw # alias to cd fastly to the workspace/angular-hello-world project
$ docker run --rm -v $(pwd):/opt/app -w /opt/app node:6-alpine yarn

After that, the node_modules directory from the host should be updated.

Note that this node_modules package is safe to checkout, delete, modify because is not used by the running dev Docker container.

Code scaffolding

Open a new terminal window and ssh into the acme-dev VM:

$ cd ~/acme-dev
$ vagrant ssh
$ ws
$ cd angular-hello-world
$ docker-compose run --rm dev <ng command>

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

Remember to sync back the generated files to the host machine with $ vagrant rsync-back: http://dev.teracy.org/docs/basic_usage.html#file-sync

Run code linting

Run $ docker-compose run --rm dev yarn run lint to execute the code lint checking.

Run unit tests

Run $ docker-compose run --rm dev yarn run test to execute the unit tests via Karma.

This will keep the tests running and watching the file changes.

To run unit tests without file watching, run $ docker-compose run --rm dev ng test --browsers Chrome_no_sandbox -w false

Run end-to-end tests

Run $ docker-compose run --rm dev yarn run e2e to execute the end-to-end tests via Protractor.

Run the bash command on the running Dev Docker image

Run $ docker-compose exec dev /bin/bash

Build the Prod Docker image

On the 4th terminal ssh-ed terminal window:

$ docker-compose exec dev ng build --prod
$ docker-compose -f docker-compose.prod.yml build

to build the project and the prod Docker image. The build artifacts will be stored in the dist/ directory.

Run the Prod Docker image

$ docker-compose -f docker-compose.prod.yml up

And open http://ahw.acme.dev or https://ahw.acme.dev to see the app in production mode served by Nginx.

Review others' work and PRs (pull requests)

To review work and PRs submitted by others, for example, with hoatle/angular-hello-world:develop Docker image, run the following command:

$ docker-compose -f docker-compose.review.yml stop && docker-compose -f docker-compose.review.yml rm -f
$ export DOCKER_IMAGE_REVIEW=hoatle/angular-hello-world:develop && \
  docker-compose -f docker-compose.review.yml pull && \
  docker-compose -f docker-compose.review.yml up

And open review.ahw.acme.dev to review different prod Docker images on local dev.

Press Ctrl + c to stop reviewing.

Contribute to angular-hello-world project

  • Fork the repo

  • Enable this repo on travis-ci.org with the following settings key - value. In the Name and Value fields, please add the info below correlatively:

    • Fill in "DOCKER_IMAGE" into the Name field, and project Docker image for Value, for example, "hoatle/angular-boilerplate" value (will be pushed to https://hub.docker.com/r/hoatle/angular-boilerplate/)
    • Fill in "DOCKER_USERNAME" into the Name field and your Docker username into the Value field
    • Fill in "DOCKER_PASSWORD" into the Name field and your Docker password into the Value field
  • Test, Fix bug, Improve, Add new features on the project issues with pull requests.

Further help

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

License

MIT, see the LICENSE file.