Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Software Heritage virtual environment packaging manifests
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
Container Registry
Model registry
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
Platform
Infrastructure
Software Heritage virtual environment packaging manifests
Commits
1cc10fa2
Unverified
Commit
1cc10fa2
authored
2 months ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
web: Unify entrypoint with others
Refs.
sysadm-environment#5560
parent
f39722db
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/swh-web/entrypoint.sh
+26
-21
26 additions, 21 deletions
apps/swh-web/entrypoint.sh
with
26 additions
and
21 deletions
apps/swh-web/entrypoint.sh
+
26
−
21
View file @
1cc10fa2
...
...
@@ -3,7 +3,7 @@
set
-e
case
"
$1
"
in
"
shell
"
)
'
shell
'
)
shift
if
((
$#
==
0
))
;
then
exec
bash
-i
...
...
@@ -11,19 +11,19 @@ case "$1" in
"
$@
"
fi
;;
"
refresh
"
)
echo
"
Start periodic save code now refresh statuses routine (in background)
"
'
refresh
'
)
echo
'
Start periodic save code now refresh statuses routine (in background)
'
exec
sh
-c
'date && django-admin refresh_savecodenow_statuses \
--settings=${DJANGO_SETTINGS_MODULE} 2>&1'
;;
"
sync-mailmaps
"
)
'
sync-mailmaps
'
)
echo
Deprecated use django-admin instead
shift
echo
"
django-admin sync-mailmaps routine
"
echo
'
django-admin sync-mailmaps routine
'
date
exec
sh
-c
"django-admin sync_mailmaps --perform '
$@
'"
;;
"
django-admin
"
)
'
django-admin
'
)
shift
COMMAND
=
$1
shift
...
...
@@ -33,23 +33,28 @@ case "$1" in
exec
sh
-c
"django-admin
${
COMMAND
}
$*
"
;;
*
)
EXTRA_CLI_FLAGS
=
""
if
[
!
-z
"
${
SWH_LOG_CONFIG_JSON
}
"
]
;
then
EXTRA_CLI_FLAGS+
=
"--log-config-json
${
SWH_LOG_CONFIG_JSON
}
"
# run gunicorn workers with production configuration
EXTRA_CLI_FLAGS
=()
if
[
-n
"
${
SWH_LOG_CONFIG_JSON
}
"
]
;
then
EXTRA_CLI_FLAGS+
=(
'--log-config-json'
"
${
SWH_LOG_CONFIG_JSON
}
"
)
fi
if
[
!
-z
"
${
S
WH_DEV_MODE
}
"
]
;
then
EXTRA_CLI_FLAGS+
=
"--reload "
if
[
-n
"
${
S
TATSD_HOST
}
"
-a
-n
"
${
STATSD_PORT
}
"
]
;
then
EXTRA_CLI_FLAGS+
=
(
'--statsd-host'
"
${
STATSD_HOST
}
:
${
STATSD_PORT
}
"
)
fi
echo
"Starting the swh-web server"
# run gunicorn workers as in production otherwise
exec
gunicorn
--bind
0.0.0.0:
${
PORT
}
\
--log-level
${
SWH_LOG_LEVEL
:-
INFO
}
\
${
EXTRA_CLI_FLAGS
}
\
--threads
${
THREADS
}
\
--workers
${
WORKERS
}
\
--timeout
${
TIMEOUT
}
\
--statsd-host
=
${
STATSD_HOST
}
:
${
STATSD_PORT
}
\
--statsd-prefix
=
${
STATSD_SERVICE_TYPE
}
\
if
[
-n
"
${
STATSD_SERVICE_TYPE
}
"
]
;
then
EXTRA_CLI_FLAGS+
=(
'--statsd-prefix'
"
${
STATSD_SERVICE_TYPE
}
"
)
fi
if
[
-n
"
${
SWH_DEV_MODE
}
"
]
;
then
EXTRA_CLI_FLAGS+
=(
"--reload"
)
fi
echo
'Starting swh web server'
exec
gunicorn
--bind
"0.0.0.0:
${
PORT
}
"
\
--log-level
"
${
SWH_LOG_LEVEL
:-
INFO
}
"
\
"
${
EXTRA_CLI_FLAGS
[@]
}
"
\
--threads
"
${
THREADS
}
"
\
--workers
"
${
WORKERS
}
"
\
--timeout
"
${
TIMEOUT
}
"
\
--access-logfile
'-'
\
--env
DJANGO_SETTINGS_MODULE
=
${
DJANGO_SETTINGS_MODULE
}
\
--config
'python:swh.web.gunicorn_config'
\
...
...
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