Commit 43cc572c authored by Kacprzak, Izabella's avatar Kacprzak, Izabella
Browse files

Modified specifying ENV in yml file [BG, IK]

parent 6eef3718
Pipeline #202275 passed with stages
in 2 minutes and 3 seconds
......@@ -4,24 +4,22 @@ stages:
test-job:
stage: test
variables:
ENV: "dev"
script:
- apt-get update -qy
- apt-get install -y python3 python3-pip
- pip3 install -r requirements.txt
- export ENV="dev"
- python3 run_tests.py test
heroku-deploy:
image: ruby:latest
stage: deploy-heroku
variables:
ENV: "prod"
script:
- apt-get update -qy
- apt-get install -y python3 python3-pip
- pip3 install -r requirements.txt
- pip3 install python-dotenv
- export ENV="prod"
- cd backend
- python3 -m flask db upgrade
- cd ..
......
......@@ -7,7 +7,7 @@ from backend.blueprints.user import user
from backend.blueprints.todo import todo
from backend.blueprints.task import task
ENV = os.environ.get("ENV", "dev")
ENV = os.environ.get("ENV")
app = Flask(__name__)
......@@ -23,7 +23,6 @@ if ENV == 'dev':
else:
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://icbwsbzlctcxyx:a0d7f73e5b743a35f33d95640b517b6e7e9e5b59cd2ff10673e90372b4b34d44@ec2-34-193-112-164.compute-1.amazonaws.com:5432/deje5qriuvrh39'
db = DB.the_database
db.app = app
......
......@@ -3,5 +3,5 @@ python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
pip install Flask python-dotenv
export DATABASE_URL='postgres://g205001034_u:CierkbZMND@db.doc.ic.ac.uk:5432/g205001034_u'
export ENV="prod"
gunicorn backend.wsgi
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment