This project is bootstrapped with Create Elm App.
-
Create a
.env
file (see .env.template for details), which needs at least Google Api Key. -
npm install
-
npm run start:server
-
npm run start:app
-
elm-app test
will run the unit tests -
npm cypress:open
will open the cypress test runner, for debugging / running the end to end tests interactively -
npm cypress:run
will run the end to end tests -
npm test
will run the unit and the end to end tests
- npm install
- npm run build
Netlify detects the package.json and runs npm install automatically. It caches the results of this and then uses the cache in subsequent builds. However the cache doesn't seem clever enough to take in to account the postinstall script (or maybe it doesn't know about elm-packages and so doesn't cache them). Either way, it stops working after the first build.
npm run netlifybuild
is used on netlify, which sorts this problem out.
There are various deployments of this code on Netlify, most of which deploy whenever there is a push to the master branch, or a pull request. You can create a new deployment using the button below.
The Netlify build process only runs the unit tests, so make sure the Appveyor build passes before merging in to master.
You can create a new league website by simply deploying this code to Netlify, using the button below. You will need to create a (free) Netlify account if you haven't already got one, and you will need to enter the following things
- The url of an Icon that will be used for the favicon and the manifest. You can use this one if you like
- The title ("League Tables" or similar)
- The Spreadsheet Id of the Google Sheet to use as the source of the Data. This sheet must be published. You can use the test one if you like (1Ai9H6Pfe1LPsOcksN6EF03-z-gO1CkNp8P1Im37N3TE)
- A Google Api Key
Then you can click this button and follow the instructions.
The usage_scenario.yml file is used with the Green Metrics Tool from Green Coding Berlin to analyse how much carbon is emitted when using the website. It tracks the emissions from running the cypress tests, which visit every page in the website, so effects of changes can be easily monitored. The lambda and the calls the the google api are not included in this.
You can see some results on the Green Metrics Tool webiste
The usage_scenario.yml is a very similar format to the docker_compose.yml, so you can run docker compose up --build --abort-on-container-exit --exit-code-from cypress
to debug locally.
Submitting runs is currently a manual process, and can be done using the Certify New Software form.