GithubHelp home page GithubHelp logo

hmcts / unspec-service Goto Github PK

View Code? Open in Web Editor NEW
2.0 8.0 2.0 3.83 MB

HMCTS Unspecified service

License: MIT License

Dockerfile 0.02% Groovy 0.44% Shell 0.68% HCL 0.24% Java 90.29% JavaScript 8.29% PLpgSQL 0.03% Python 0.02%

unspec-service's Introduction

This repo is now deprecated the following ones are used instead

civil-damages-claims

Build Status

Civil Damages Claims's CCD Callback Service.

Contents:

Prerequisites:

Run command:

git submodule init
git submodule update

Add services, roles and users (in this order) from civil-unspecified-docker repository using scripts located in bin directory.

Load CCD definition:

CCD definition is stored in JSON format. To load it into CCD instance run:

$ ./bin/import-ccd-definition.sh

Note: Above script will export JSON content into XLSX file and upload it into instance of CCD definition store.

Additional note:

You can skip some of the files by using -e option on the import-ccd-definitions, i.e.

$ ./bin/import-ccd-definition.sh -e UserProfile.json,*-nonprod.json

The command above will skip UserProfile.json and all files with -nonprod suffix (from the folders).

Testing

The repo uses codeceptjs framework for e2e tests.

To install dependencies enter yarn install.

To run e2e tests enter yarn test in the command line.

Optional configuration

To run tests with browser window open set SHOW_BROWSER_WINDOW=true. By default, the browser window is hidden.

Smoke test

To run smoke tests enter yarn test:smoke.

API test

To run API tests enter yarn test:api.

Contract testing

Generate contracts

You can generate contracts as follows:

./gradlew contract

Publish contracts

If you want to publish the contracts to hmcts pact broker, please set this env variable accordingly before running the publish command.

export PACT_BROKER_FULL_URL=http://pact-broker.platform.hmcts.net/

and if you want to publish the RPA contract to the PactFlow pact broker, please set this env variable accordingly before running the publish command. By setting your env variable to this, the IDAM contract will be ignored and only the RPA contract will be published to PactFlow.

export PACT_BROKER_FULL_URL=https://civil-damages-claims.pactflow.io/

Before running, you should set the API token to connect to the pactflow portal as follows:

export PACT_BROKER_TOKEN=<api token here>

The API Token can be obtained on Confluence.

To publish your contracts:

./gradlew pactPublish
  • If connecting to Pactflow, please disable the HMCTS VPN.

Building and deploying the application

Building the application

The project uses Gradle as a build tool. It already contains ./gradlew wrapper script, so there's no need to install gradle.

To build the project execute the following command:

  ./gradlew build

Running the application

Create the image of the application by executing the following command:

  ./gradlew assemble

Create docker image:

  docker-compose build

Run the distribution (created in build/install/unspec-service directory) by executing the following command:

  docker-compose up

This will start the API container exposing the application's port (set to 4000 in this template app).

In order to test if the application is up, you can call its health endpoint:

  curl http://localhost:4000/health

You should get a response similar to this:

  {"status":"UP","diskSpace":{"status":"UP","total":249644974080,"free":137188298752,"threshold":10485760}}

Alternative script to run application

To skip all the setting up and building, just execute the following command:

./bin/run-in-docker.sh

For more information:

./bin/run-in-docker.sh -h

Script includes bare minimum environment variables necessary to start api instance. Whenever any variable is changed or any other script regarding docker image/container build, the suggested way to ensure all is cleaned up properly is by this command:

docker-compose rm

It clears stopped containers correctly. Might consider removing clutter of images too, especially the ones fiddled with:

docker images

docker image rm <image-id>

There is no need to remove postgres and java or similar core images.

Camunda

Camunda UI runs on http:localhost:9404. You can login with:

username: demo
password: demo

The REST API is available at http:localhost:9404/engine-rest/. The REST API documentation is available here.

To upload all bpmn diagrams via the REST API there is a script located in ./bin directory. Run ./bin/import-bpmn-diagram.sh . to upload it to Camunda. The diagram must exist within src/main/resources/camunda. By setting CAMUNDA_BASE_URL env variable you can also use this script to upload diagrams to Camunda in other environments.

License

This project is licensed under the MIT License - see the LICENSE file for details

unspec-service's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar devmarcy avatar dharmendrak avatar douglasrice avatar pd-dudkiewicz avatar sabahirfan avatar swalker125 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.