Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Building, debugging, and linting

Sam Heaton edited this page Aug 20, 2019 · 1 revision

Building the application locally

Prerequisites for building ScreenDoor locally are:

  • docker
  • docker-compose

Build using docker-compose build and run with docker-compose up inside the project directory.

The only valid inputs for this program are Government of Canada job postings and applications in PDF format. The application will also not run without a valid settings.ini file containing secrets.

Debugging

Debugging locally on non-asynchronous functions can be done using pdb. Simply add breakpoint() at any point in the code, run docker attach screendoor in a terminal in the project root, and execute the code.

Linting code through SonarQube

The master-dev branch has SonarQube integrated into its build pipeline. To run code review and analysis:

  1. Switch to branch master-dev.
  2. Run docker-compose build.
  3. Download the latest Linux build of sonar-scanner from here.
  4. Extract the contents of the sonar-scanner zip into a sonar-scanner folder in the project root.
  5. Start ScreenDoor with docker-compose up.
  6. Open SonarQube at localhost:9000. Log in with username and password "admin".
  7. Start a new project, with name and key screendoor.
  8. Take the generated token and edit docker-compose.yml to replace the value after -Dsonar.login=
  9. Configure SonarQube by clicking on the project, then "administration," and "Analysis Scope."
  10. Use the following Source File Inclusions:
  • screendoor/**
  • screendoor_app/**
  • static/js/es6/**
  • static/css/style.css
  1. For test coverage, go to General Settings->Python and set Path to coverage report(s) to **coverage*.xml
  2. Re-run docker-compose up.
  3. After sonar-scanner is complete, visit localhost:9000 to verify success.

Clone this wiki locally