diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 14af3ec5b..8838fdb77 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -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 diff --git a/Dockerfile-dev b/Dockerfile-dev index 443aecd6a..17834a6f4 100644 --- a/Dockerfile-dev +++ b/Dockerfile-dev @@ -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 diff --git a/Makefile b/Makefile index 9e408eee4..67c5423bb 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 @@ -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