Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kacprzak, Izabella
DRP-InAGlobe-Platform
Commits
43cc572c
Commit
43cc572c
authored
Jun 13, 2021
by
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
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
43cc572c
...
...
@@ -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 ..
...
...
backend/main.py
View file @
43cc572c
...
...
@@ -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
...
...
run_backend.sh
View file @
43cc572c
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment