Public | Automated Build

Last pushed: 2 days ago
Short Description
Export Wins MI Front end
Full Description

Export Wins MI

A front end project to show some MI data for Export Wins


Dependenies

All dependencies come from NPM

Setup

After checkout run:

npm install

Starting the app

Production

To start the app in production:

npm start

This will use server.js to run the app as a child process, if the child process crashes then it will be respawned.

If the SERVER_WORKERS env variable is set to more than 1, it will use the cluster module and will spin up x amount of workers as specified.

To run just the app directly (not as a child process from server.js):

npm run app

Development

To run in development mode (watching files for changes):

npm run watch

To run in development mode and also use fake stubs, first you need to generate the stubs:

node src/data/create-backend-fake-stubs.js

This should log a message to say how many files were written, now you can run the app with those stubs:

npm run watch-stub

Testing

To test the Node code:

npm test

To test the client side code:

npm run test-client

Releases

If you have a small branch with minimal commits then run the commands below on the branch. If you have a lot of commits over a long period of time then create a new release branch.

First check the current version:

npm version

Now decide what the next semver version will be and create the branch:

git checkout master
git checkout -b release-vx.x.x

The commands below will change the version in the package.json and the npm-shrinkwrap.json and then it will create a git tag and try to push the branch and the tag.

Choose the next correct semver version and run the appropriate command:

Patch

Bug fixes and small changes.

npm version patch

Minor

Backwards compatible changes and new features.

npm version minor

Major

Breaking changes.

npm version major

Errors

If you have not pushed the local branch then running the command above will output an error. Just copy and run the git push command (output in the error) and then run:

git push origin --tags

To push the tag up to origin.

Now you can create a PR in github, but you will have to wait for CircleCI to build and run the tests before you can merge. Once the merge is complete CircleCI will run the build and tests again.

Deploy

ITHC

Heroku will auto build and deploy from develop onto the ITHC env.

Staging/Production

Heroku will auto build master on to the staging environment but you will need to use the "Promote to Production" button on the Heroku dashboard to deploy to Production.

Docker

Docker compose

Docker images are built automatically by docker hub for all branches and version tags.

To start all the services you can use docker compose:

docker-compose up

Which will require a database to be running and DATABASE_URL env var to be defined

To start a clean db, use with the over ride file:

docker-compose -f docker-compose.yml -f docker-compose.clean.yml up
Docker Pull Command
Owner
ukti
Source Repository