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