Skip to content

Commit

Permalink
Merge branch 'master' into zwe-config-addtl-boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
wadhwamatic authored Oct 24, 2023
2 parents 8bf530a + 9bc7b5f commit cb7ecca
Show file tree
Hide file tree
Showing 77 changed files with 6,052 additions and 654 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# this file is only used to build the frontend image
# NOT for the python api (see api/.dockerignore for that)
common/node_modules/**
frontend/node_modules/**
alerting/*
api/*
docs/*
56 changes: 56 additions & 0 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# for comment on PR, follow instruction for: https://github.com/marketplace/actions/sticky-pull-request-comment
name: PRISM CI - API
on:
# Run on all pull requests and on pushes to master.
pull_request:
push:
branches:
- master

jobs:
api_lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
# run the matrix jobs one after the other, so they can benefit from caching
max-parallel: 1

steps:
- uses: actions/checkout@v4
- name: Install Poetry
uses: snok/install-poetry@v1
with:
# Version of Poetry to use
version: 1.6.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: |
cd api
poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Check formatting with black and isort
run: |
cd api
poetry run black --check .
poetry run isort --check .
api_build:
name: build and test api
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Docker Compose
run: |
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-`uname -s`-`uname -m` -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
docker compose version
- name: Build containers
run: cd api && make build
- name: Run tests
run: cd api && make api-test

46 changes: 1 addition & 45 deletions .github/workflows/build.yml → .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# for comment on PR, follow instruction for: https://github.com/marketplace/actions/sticky-pull-request-comment
name: PRISM CI
name: PRISM CI - Frontend
on:
# Run on all pull requests and on pushes to master.
pull_request:
Expand Down Expand Up @@ -172,47 +172,3 @@ jobs:
project: "frontend/build/."
login: ${{ secrets.surge_login }}
token: ${{ secrets.surge_token }}

api_lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
# run the matrix jobs one after the other, so they can benefit from caching
max-parallel: 1

steps:
- uses: actions/checkout@v2
- name: Install Poetry
uses: snok/install-poetry@v1
with:
# Version of Poetry to use
version: 1.4.2
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: |
cd api
poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Check formatting with black and isort
run: |
cd api
poetry run black --check .
poetry run isort --check .
api_build:
name: build api
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Docker Compose
run: |
curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose
chmod +x ~/docker-compose
sudo mv ~/docker-compose /usr/local/bin/docker-compose
- name: Build containers
run: cd api && docker-compose build api
- name: Run tests
run: cd api && make api-test
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,18 @@ This project was bootstrapped with [Create React App](https://github.com/faceboo
- **Mapping** Uses [MapLibre](https://maplibre.org/maplibre-gl-js-docs/api/). The app supports Maptiler and Mapbox styles. To use Mapbox styles, you will need to create a token and add it as `REACT_APP_MAPBOX_TOKEN` in a `.env` file at the root folder. Then specify your style url using `REACT_APP_DEFAULT_STYLE`.
- **WFP authentication** Uses [msal](https://github.com/AzureAD/microsoft-authentication-library-for-js). You need to include within your .env file the variables `REACT_APP_OAUTH_CLIENT_ID`, `REACT_APP_OAUTH_AUTHORITY` and `REACT_APP_OAUTH_REDIRECT_URI`. Also, set the `WFPAuthRequired` flag within the country prism.json file
### Developing the frontend
The following commands should get you a local development instance of the frontend:
```
cd frontend
yarn clean
yarn install
yarn setup:common
REACT_APP_COUNTRY=cambodia yarn start
```
### Available Scripts
In the project directory, you can run:
Expand Down
2 changes: 1 addition & 1 deletion alerting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"migration:revert": "yarn typeorm migration:revert",
"typeorm-seeding": "ts-node $(yarn bin typeorm-seeding)",
"alert-worker": "yarn ts-node src/alert-worker.ts",
"docker-alert": "docker-compose run --entrypoint 'yarn alert-worker' alerting-node"
"docker-alert": "docker compose run --entrypoint 'yarn alert-worker' alerting-node"
},
"dependencies": {
"@turf/bbox": "^6.3.0",
Expand Down
Loading

0 comments on commit cb7ecca

Please sign in to comment.