Skip to content

Commit

Permalink
Revert "backend runs on 5001 (#495)" (#498)
Browse files Browse the repository at this point in the history
This reverts commit e5929f5.
  • Loading branch information
northdpole committed May 21, 2024
1 parent 9a00c3d commit c3e211b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
- name: Run app and e2e tests
run: |
yarn build
make dev-flask&
[ -d "./venv" ] && . ./venv/bin/activate
export FLASK_APP=./cre.py
export FLASK_CONFIG=development
export INSECURE_REQUESTS=1
FLASK_CONFIG=development flask run &
sleep 20s
yarn test:e2e
4 changes: 3 additions & 1 deletion Dockerfile-dev
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ FROM python:3.11.0 as run
COPY --from=build /code /code
WORKDIR /code
RUN apt update &&\
apt install -y python3-numpy python3-virtualenv python3-pip &&\
apt install -y python3-numpy &&\
pip install virtualenv &&\
make install-deps-python &&\
make install-python

ENTRYPOINT make dev-flask
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,18 @@ docker-redis:
start-containers: docker-neo4j docker-redis

start-worker:
. ./venv/bin/activate &&\
FLASK_APP=`pwd`/cre.py python cre.py --start_worker
. ./venv/bin/activate && FLASK_APP=`pwd`/cre.py python cre.py --start_worker

dev-flask:
. ./venv/bin/activate &&\
FLASK_RUN_PORT="5002" INSECURE_REQUESTS=1 FLASK_APP=`pwd`/cre.py FLASK_CONFIG=development flask run
. ./venv/bin/activate && INSECURE_REQUESTS=1 FLASK_APP=`pwd`/cre.py FLASK_CONFIG=development flask run

e2e:
yarn build
make dev-flask&
[ -d "./venv" ] && . ./venv/bin/activate &&\
export FLASK_APP=$(CURDIR)/cre.py &&\
export FLASK_CONFIG=development &&\
export INSECURE_REQUESTS=1 &&\
flask run &
sleep 5
yarn test:e2e
sleep 20
Expand Down Expand Up @@ -98,10 +100,10 @@ docker-prod:
docker build -f Dockerfile -t opencre:$(shell git rev-parse HEAD) .

docker-dev-run:
docker run -it -p 5002:5002 opencre-dev:$(shell git rev-parse HEAD)
docker run -it -p 5000:5000 opencre-dev:$(shell git rev-parse HEAD)

docker-prod-run:
docker run -it -p 5002:5002 opencre:$(shell git rev-parse HEAD)
docker run -it -p 5000:5000 opencre:$(shell git rev-parse HEAD)

lint:
[ -d "./venv" ] && . ./venv/bin/activate && black . && yarn lint
Expand Down Expand Up @@ -162,6 +164,6 @@ preload-map-analysis:
sleep 5
[ -d "./venv" ] && . ./venv/bin/activate &&\
export FLASK_APP=$(CURDIR)/cre.py
python cre.py --preload_map_analysis_target_url 'http://127.0.0.1:5002'
python cre.py --preload_map_analysis_target_url 'http://127.0.0.1:5000'
killall python flask
all: clean lint test dev dev-run

0 comments on commit c3e211b

Please sign in to comment.