Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rosetta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ExaCT
Rosetta
Commits
59ce5e34
Commit
59ce5e34
authored
4 years ago
by
Stefano Alberto Russo
Browse files
Options
Downloads
Patches
Plain Diff
Disabled automatic migrations & populate. Settings cleanup.
parent
a16564b5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
services/webapp/code/rosetta/settings.py
+2
-2
2 additions, 2 deletions
services/webapp/code/rosetta/settings.py
services/webapp/run_webapp.sh
+8
-51
8 additions, 51 deletions
services/webapp/run_webapp.sh
with
10 additions
and
53 deletions
services/webapp/code/rosetta/settings.py
+
2
−
2
View file @
59ce5e34
...
...
@@ -157,12 +157,12 @@ TMP_PATH = '/tmp/'
# Email settings
#===============================
DJANGO_PUBLIC_HTTP_HOST
=
os
.
environ
.
get
(
'
DJANGO_PUBLIC_HTTP_HOST
'
,
'
http://localhost
:8080
'
)
DJANGO_PUBLIC_HTTP_HOST
=
os
.
environ
.
get
(
'
DJANGO_PUBLIC_HTTP_HOST
'
,
'
http://localhost
'
)
DJANGO_EMAIL_SERVICE
=
os
.
environ
.
get
(
'
DJANGO_EMAIL_SERVICE
'
,
'
Sendgrid
'
)
if
not
DJANGO_EMAIL_SERVICE
in
[
'
Sendgrid
'
,
None
]:
raise
ImproperlyConfigured
(
'
Invalid EMAIL_METHOD (
"
{}
"
)
'
.
format
(
DJANGO_EMAIL_SERVICE
))
DJANGO_EMAIL_FROM
=
os
.
environ
.
get
(
'
DJANGO_EMAIL_FROM
'
,
'
Rosetta
Platform <info@rosetta.platform>
'
)
DJANGO_EMAIL_FROM
=
os
.
environ
.
get
(
'
DJANGO_EMAIL_FROM
'
,
'
Rosetta
<notifications@rosetta.local
'
)
DJANGO_EMAIL_APIKEY
=
os
.
environ
.
get
(
'
DJANGO_EMAIL_APIKEY
'
,
None
)
...
...
This diff is collapsed.
Click to expand it.
services/webapp/run_webapp.sh
+
8
−
51
View file @
59ce5e34
...
...
@@ -8,7 +8,8 @@ echo " Starting Webapp @ $DATE"
echo
"==================================================="
echo
""
echo
"1) Loading/sourcing env and settings"
echo
"Loading/sourcing env and settings..."
echo
""
# Load env
source
/env.sh
...
...
@@ -16,60 +17,16 @@ source /env.sh
# Database conf
source
/db_conf.sh
# Django Project conf
if
[[
"x
$DJANGO_PROJECT_NAME
"
==
"x"
]]
;
then
export
DJANGO_PROJECT_NAME
=
"Rosetta"
fi
if
[[
"x
$DJANGO_PUBLIC_HTTP_HOST
"
==
"x"
]]
;
then
export
DJANGO_PUBLIC_HTTP_HOST
=
"https://rosetta.platform"
fi
if
[[
"x
$DJANGO_EMAIL_SERVICE
"
==
"x"
]]
;
then
export
DJANGO_EMAIL_SERVICE
=
"Sendgrid"
fi
if
[[
"x
$DJANGO_EMAIL_FROM
"
==
"x"
]]
;
then
export
DJANGO_EMAIL_FROM
=
"Rosetta <rosetta@rosetta.platform>"
fi
if
[[
"x
$DJANGO_EMAIL_APIKEY
"
==
"x"
]]
;
then
export
DJANGO_EMAIL_APIKEY
=
""
fi
# Stay quiet on Python warnings
export
PYTHONWARNINGS
=
ignore
# To Python3 (unbuffered). P.s. "python3 -u" does not work..
export
DJANGO_PYTHON
=
python3
export
PYTHONUNBUFFERED
=
on
# Check if there is something to migrate or populate
echo
""
echo
"2) Making migrations..."
cd
/opt/code
&&
$DJANGO_PYTHON
manage.py makemigrations
--noinput
EXIT_CODE
=
$?
echo
"Exit code:
$EXIT_CODE
"
if
[[
"x
$EXIT_CODE
"
!=
"x0"
]]
;
then
echo
"This exit code is an error, sleeping 5s and exiting."
sleep
5
exit
$?
fi
echo
""
echo
"3) Migrating..."
cd
/opt/code
&&
$DJANGO_PYTHON
manage.py migrate
--noinput
EXIT_CODE
=
$?
echo
"Exit code:
$EXIT_CODE
"
if
[[
"x
$EXIT_CODE
"
!=
"x0"
]]
;
then
echo
"This exit code is an error, sleeping 5s and exiting."
sleep
5
exit
$?
fi
echo
""
echo
"4) Populating core app..."
cd
/opt/code
&&
$DJANGO_PYTHON
manage.py core_app_populate
# Apply migrations if any
# Note: this will also indirectly wait for the DB to become up and reachable
echo
"Applying migrations if any..."
cd
/opt/code
&&
python3 manage.py migrate
--noinput
EXIT_CODE
=
$?
echo
"Exit code:
$EXIT_CODE
"
if
[[
"x
$EXIT_CODE
"
!=
"x0"
]]
;
then
...
...
@@ -80,5 +37,5 @@ fi
echo
""
# Run the (development) server
echo
"
5)
Now starting the server and logging in /var/log/
cloud_
server.log."
exec
$DJANGO_PYTHON
manage.py runserver 0.0.0.0:8080 2>> /var/log/webapp/server.log
echo
"Now starting the server and logging in /var/log/
webapp/
server.log."
exec
python3
manage.py runserver 0.0.0.0:8080 2>> /var/log/webapp/server.log
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment