Commit d73ecf13 authored by Lisa Casino's avatar Lisa Casino

html5as: add graceful restart, nginx port is a parameter

parent dea1fb21
......@@ -17,11 +17,11 @@
[template-cfg]
filename = instance.cfg.in
md5sum = e455ee1206dbd1c8c9623c4a58fc5524
md5sum = feb337447d23df4c5f986884b625806a
[instance_html5as]
_update_hash_filename_ = instance_html5as.cfg.in
md5sum = 3d8b257b221aca622ee9e9a1104ec977
md5sum = 6ab121292f03a13eadbd88d019638efb
[template_nginx_conf]
_update_hash_filename_ = templates/nginx_conf.in
......@@ -38,3 +38,7 @@ md5sum = 4ef94a7b458d885cd79ba0b930a5727e
[template_index_html]
_update_hash_filename_ = templates/index.html.in
md5sum = d57cb01df5941e139b02a2f7bdabcdc8
[template_graceful]
_update_hash_filename_ = templates/graceful.in
md5sum = 1c0ee16966e1fcdb3fd11c09f12ee2b2
......@@ -15,6 +15,7 @@ template_nginx_conf = {{ template_nginx_conf_target }}
template_mime_types = {{ template_mime_types_target }}
template_launcher = {{ template_launcher_target }}
template_index_html = {{ template_index_html_target }}
template_graceful = {{ template_graceful_target }}
[instance-html5as]
recipe = slapos.recipe.template:jinja2
......@@ -30,7 +31,8 @@ context =
default-parameters =
{
"title": "Tutorial html5as",
"download_url": ""
"download_url": "",
"port": 8081
}
[switch-softwaretype]
......
......@@ -11,6 +11,7 @@ parts =
downloader
mime_types
launcher
nginx-graceful
publish-connection-information
# Define egg directories to be the one from Software Release
......@@ -73,7 +74,7 @@ nb_workers = 2
# Network
ip = {{ ipv6_random }}
port = 8081
port = {{ parameter_dict['port'] }}
access_url = http://[${:ip}]:${:port}
# Paths
......@@ -100,6 +101,15 @@ bin_launcher = ${basedirectory:script}/launcher
# Utils
path_nginx = {{ parameter_list['nginx_location'] }}/sbin/nginx
### Nginx Graceful
[nginx-graceful]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_list['template_graceful'] }}
rendered = ${basedirectory:script}/nginx-graceful
mode = 0700
context =
section param_html5as html5as
# Render nginx conf
[nginx_conf]
recipe = slapos.recipe.template:jinja2
......
......@@ -43,6 +43,7 @@ context =
key template_launcher_target template_launcher:target
key template_instance_html5as_target instance_html5as:target
key template_index_html_target template_index_html:target
key template_graceful_target template_graceful:target
[download-base]
recipe = slapos.recipe.build:download
......@@ -66,6 +67,9 @@ mode = 0644
[template_index_html]
<= download-base
[template_graceful]
<= download-base
[extra-eggs]
recipe = zc.recipe.egg
eggs =
......
#! {{ param_html5as['path_shell'] }}
# BEWARE: This file is operated by slapos node
# BEWARE: It will be overwritten automatically
# Run graceful
exec kill -s SIGHUP $(cat {{ param_html5as['path_pid'] }})
Markdown is supported
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