NodeGoat icon indicating copy to clipboard operation
NodeGoat copied to clipboard

Feature: Lerna

Open UlisesGascon opened this issue 5 years ago • 2 comments
trafficstars

WIP. No Merge:

Pending

  • [ ] Documentation
    • Readme root
    • Readme server-render
  • [ ] Heroku

Context

  • Related #187

Changelog

  • 805d251 server-render app moved to new location apps/server-render by @UlisesGascon
  • 70316df Added Lerna initialization by @UlisesGascon
  • 364b36b update exception rules by @UlisesGascon
  • 01e72af server-render app renamed by @UlisesGascon
  • d9e8a23 Added githooks tasks to server-render by @UlisesGascon
  • 2a79334 Added main project tasks by @UlisesGascon
  • f211301 Lint execution 💪by @UlisesGascon
  • fd4f30e CI extended to work with Lerna by @UlisesGascon

UlisesGascon avatar Mar 18 '20 17:03 UlisesGascon

@ckarande and @lirantal seems like I was able to fix the CI issues with Lerna. 🎉

I will work now on the documentation and then I will work to enable tests in CI for #193 and #197.

Important

This PR seems quite big but only few files were created/edited:

  • travis.yml for CI
  • README.md soon
  • ./package.json and ./lerna.json for Lerna (dependencies and npm scripts) and Husky (git hooks and propagation)

The rest of the files were just moved to a new location apps/server-render/** and somehow relinted

Note

We will need to review Heroku official deployment (https://nodegoat.herokuapp.com/tutorial) becuase maybe this PR will break de deploy? 🤔

UlisesGascon avatar May 30 '20 12:05 UlisesGascon

In feature/187 Travis uses Lerna to start the infrastructure. Lerna invokes the start-infra npm script which runs the web service in a docker container. The dockerfile builds the server-render_web image from a base of node:12-alpine.

I think that means the web service is only tested under node 12 in this branch, despite there being travis jobs for node 8, 10 and 12.

EDIT: Also it appears that the before/after hooks that reset the DB don't work in this branch. The docker-compose.yml doesn't map the mongo port out to the host. That means the database is only accessible from other services (just web in this case), and not from the cypress tests running directly on the host VM.

EDIT 2: When launched with docker-compose up the web service always connects to the mongolab DB rather than the mongo service running inside docker. This is because NODE_ENV isn't set, so development is used by default. That's why only one of the CI jobs succeeds in each run for this branch - another job already created the new user.

rcowsill avatar Aug 06 '20 15:08 rcowsill