The Energy Performance of Buildings Register service consists of several distinct applications.
- authentication server
- epb api
- epb frontend
These dev tools give us a stable environment where all the applications are preconfigured to just work.
Requirements
- docker
- docker-compose
- git
- bash 4 or greater (only if using installation scripts)
The scripted installation was tested on macOS. For other OSs you may want to run through the manual installation instructions.
- Create a new directory
MHCLG
to store the dev tools - Clone this repository into the
MHCLG
directory so it is located atMHCLG/epb-dev-tools
- From the directory
MHCLG/epb-dev-tools
run the installation scriptmake install
This script will ask for sudo access as part of the installation, this is needed
to create the needed entries in /etc/hosts
.
Requirements
- vagrant
- vagrant hostsupdater (
vagrant plugin install vagrant-hostsupdater
) - virtualbox
To run the whole infrastructure in a vagrant environment just run the following:
$ vagrant up
# ... wait for the installation to finish
$ vagrant reload
Although unsupported, instructions to manually install epb dev tools can be found here.
Assuming all the installation steps succeeded, you can now start the EPB register service.
$ epb start
When you want to ensure that your local copy of the service is up to date, you
can run the following from the MHCLG/epb-dev-tools
folder.
$ git pull # will ensure that the epb-dev-tools repo is up to date
$ make install # will ensure that the docker compose file is up to date
There are three services that make up the Energy Performance of Buildings Register
- The register api - found at http://epb-register-api
- The register's authentication service - found at http://epb-register-api/auth
- The register's frontend service - found at http://find-energy-certificate.epb-frontend and http://getting-new-energy-certificate.epb-frontend
Before you use them, you will need to run some updates on the toggles database:
- Go to the toggles / feature flag db container in docker desktop
- Run
psql postgresql://unleashed:superSecret30CharacterPassword@epb-feature-flag-db/unleashed
- Once you have connected to the database, run:
update environments set enabled = true, protected = false where name = 'default';
Insert into project_environments (project_id, environment_name) values ('default', 'default');
- You can now create toggles in the feature flags application found at http://epb-feature-flag/features
The make migrate
command migrates a database for a particular application.
If you get an error saying that a database table is missing for a particular application
then running this command should regenerate the database & its tables for you.
If you encounter this warning when trying to run the command
Must give an application EPB Devtools Help
then please use this alternative syntax:
make migrate APP=<particular_application>
Eg: make migrate APP=epb-register-api
To add test assessments into your database and data warehouse in docker, first ensure you have the latest version of the the register api, then run the command:
make load-local-data
This lodges 63 different assessments, from varying schemas with different energy ratings.
Additional requirements
- jq (
brew install jq
) - yq (
brew install yq
)
With these additional packages installed you can then run a Zap scan of the API and frontend apps using
$ make security-scan