Commit b38e99b9 authored by Thomas Lechauve's avatar Thomas Lechauve

Separate download process from running process.

parent 3e01dcb2
[buildout]
parts =
nginx_conf
html5as_bin
downloader
launcher
mime_types
publish-connection-information
......@@ -72,7 +73,8 @@ path_nginx_conf = $${rootdirectory:etc}/nginx.conf
path_mime_types = $${rootdirectory:etc}/mime_types
# Executables
bin_nginx = ${nginx:location}/sbin/nginx
bin_html5as = $${basedirectory:services}/html5as
bin_launcher = $${basedirectory:services}/launcher
bin_downloader = $${basedirectory:services}/downloader
# Utils
path_shell = ${dash:location}/bin/dash
......@@ -92,15 +94,23 @@ recipe = slapos.recipe.template:jinja2
template = ${template_mime_types:location}/${template_mime_types:filename}
rendered = $${html5as:path_mime_types}
[html5as_bin]
[downloader]
recipe = slapos.recipe.template:jinja2
template = ${template_html5as_bin:location}/${template_html5as_bin:filename}
rendered = $${html5as:bin_html5as}
template = ${template_downloader:location}/${template_downloader:filename}
rendered = $${html5as:bin_downloader}
mode = 700
context =
section param_html5as html5as
key download_url slap-parameter:download_url
[launcher]
recipe = slapos.recipe.template:jinja2
template = ${template_launcher:location}/${template_launcher:filename}
rendered = $${html5as:bin_launcher}
mode = 700
context =
section param_html5as html5as
[publish-connection-information]
recipe = slapos.cookbook:publish
server_url = http://[$${html5as:ip}]:$${html5as:port}
......@@ -27,7 +27,8 @@ parts =
eggs
template
template_nginx_conf
template_html5as_bin
template_downloader
template_launcher
template_mime_types
instance_html5as
......@@ -46,7 +47,7 @@ mode = 0644
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance_html5as.cfg
output = ${buildout:directory}/template_html5as.cfg
md5sum = dd362b85a84d30936084aac91a0c711c
md5sum = 579eceb768e8d25fb53338fc4fac6944
mode = 0644
[template_nginx_conf]
......@@ -57,11 +58,19 @@ filename = nginx_conf.in
mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_}
[template_html5as_bin]
[template_launcher]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/templates/html5as_bin.in
md5sum = 4c5043743fd6a7f0a54eee88ea074ce2
filename = html5as_bin.in
url = ${:_profile_base_location_}/templates/launcher.in
md5sum = acf5bb55ceac2e826259d28ed5c1de3a
filename = launcher.in
mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_}
[template_downloader]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/templates/downloader.in
md5sum = 7b374a03f4086fcae47491d449da1f09
filename = downloader.in
mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_}
......
......@@ -7,6 +7,3 @@ rm -r {{ param_html5as['docroot'] }}/*
# Download and extract website tarball into docroot directory
exec {{ param_html5as['path_curl'] }} -s {{ download_url }} | {{ param_html5as['path_tar'] }} -z -x -C {{ param_html5as['docroot'] }}
# Run nginx
exec {{ param_html5as['bin_nginx'] }} -c {{ param_html5as['path_nginx_conf'] }}
#! {{ param_html5as['path_shell'] }}
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
# Run nginx
exec {{ param_html5as['bin_nginx'] }} -c {{ param_html5as['path_nginx_conf'] }}
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