GithubHelp home page GithubHelp logo

ministryofjustice / opg-use-an-lpa Goto Github PK

View Code? Open in Web Editor NEW
4.0 21.0 4.0 43.92 MB

OPG Use An LPA: Managed by opg-org-infra & Terraform

License: MIT License

HCL 8.27% PHP 66.95% Dockerfile 0.19% Python 3.58% Gherkin 3.80% Shell 0.55% JavaScript 1.85% Go 3.80% Twig 10.56% SCSS 0.32% Makefile 0.13%

opg-use-an-lpa's Introduction

opg-use-my-lpa

OPG Use My LPA: Managed by opg-org-infra & Terraform

path to live status

codecov coverage status

repo standards badge

Setup

Clone the following repository into the same base directory:

Additionally, work related to Use is done in:

All commands assume a working directory of opg-use-my-lpa.

Makefile

A Makefile is maintained that aliases the most useful docker-compose commands.

To build the service and it's dependencies

make build_all

To start the service and its dependencies

make up_all # start ual and all dependencies then run seeding of local data

To stop the service and its dependencies (ordering is important so that the networks are removed last)

make down_all # bring down everything including the lpa endpoint

There are other make file targets for common operations such as

logs to follow docker-compose logs for the service seed to rerun seeding scripts to put or reset fixture data destroy to stop the service and remove all images

Build images with no cache option. Run this regularly to keep base docker images up to date, as these include potential security fixes.

make rebuild [container name]

Note: this can take several minutes to run.

To bring up the local environment

make up_all

If you plan on developing the application i:e in most cases, you should also enable development mode.

make development_mode

Development mode is essential to run the stack locally (unless SSL is setup) as without it sessions do not function. You will be unable to login and all CSRF protected forms will be broken.

The Viewer service will be available via http://localhost:9001/home

The Actor service will be available via http://localhost:9002/home

The API service will be available via http://localhost:9003

Tests

To run all the unit tests (the command for viewer-app and actor-app will run exactly the same suite of unit tests in the front service)

make unit_test_all

# or, seperately
make unit_test_viewer_app
make unit_test_actor_app
make unit_test_javascript

Functional (Behat) test

To run the Behat smoke tests

make smoke_tests

There other some other utility scripts in the composer.json for example

cd service-api/app
composer run psalm

# to pass arguments to a composer script start with a double hyphen "--".
composer run int-test -- --verbose

Updating composer dependencies

Composer install is run when the app container is built, and on a standard docker-compose up.

It can also be run independently with:

# Arbitrary commands such as "require author/package" or "remove author/package"
make run_api_composer -- [composer command]
make run_front_composer -- [composer command]

# explicit install or update
make run_api_composer_install
make run_api_composer_update

make run_front_composer_install
make run_front_composer_update

Troubleshooting

There are occasions when your local dev environment doesn't quite act as it should. Feel free to add further troubleshooting steps here.

Here are some common problems we've come across:

I cannot login with the seeded user

Its possible seeding of Use an LPA was not successful. make sure all docker compose services are running and have settled first, then try again. run the following command:

make seed

then try again

I cannot add LPA's locally, which are in the seeded data set

Ensure that the api-gateway container is running

docker ps | grep opg-use-an-lpa-codes-gateway

If this is not running, you should re-run

make up_all

if that doesn't work try running

make update_mock

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.