Commit f693b1d9 authored by Nirina Malard's avatar Nirina Malard

software/html5as-base : add curl and tar components

parent b745f665
......@@ -18,11 +18,11 @@
[template-cfg]
filename = instance.cfg.in
md5sum = 1be13f7f98eb741a82414cd75bf41e6f
md5sum = 9da3d36e19b15fce5413afa96d596599
[instance_html5as]
_update_hash_filename_ = instance_html5as.cfg.in
md5sum = 26b62d36f79f59f8064df3dfc857a801
md5sum = 03742c8c59cb8bade39b5932a0c2f6d2
[template_nginx_conf]
_update_hash_filename_ = templates/nginx_conf.in
......@@ -39,4 +39,3 @@ md5sum = 4ef94a7b458d885cd79ba0b930a5727e
[template_index_html]
_update_hash_filename_ = templates/index.html.in
md5sum = d57cb01df5941e139b02a2f7bdabcdc8
......@@ -9,6 +9,8 @@ offline = true
[profile-common]
nginx_location = {{ nginx_location }}
dash_location = {{ dash_location }}
tar_location = {{ tar_location }}
curl_location = {{ curl_location }}
template_nginx_conf = {{ template_nginx_conf_target }}
template_mime_types = {{ template_mime_types_target }}
template_launcher = {{ template_launcher_target }}
......@@ -29,7 +31,8 @@ context =
jsonkey default_parameter_dict :default-parameters
default-parameters =
{
"title": "Tutorial html5as"
"title": "Tutorial html5as",
"download_url": ""
}
[switch-softwaretype]
......
......@@ -93,6 +93,8 @@ path_nginx_conf = ${directory:etc}/nginx.conf
path_mime_types = ${directory:etc}/mime_types
# Binaries
path_shell = {{ parameter_list['dash_location'] }}/bin/dash
curl-binary = {{ parameter_list['curl_location'] }}/bin/curl
tar-binary = {{ parameter_list['tar_location'] }}/bin/tar
# Executables
bin_launcher = ${basedirectory:script}/launcher
......@@ -123,10 +125,25 @@ output = ${html5as:bin_launcher}
context =
section param_html5as html5as
# Simple command to put content in the docroot
# Command to put content in the docroot
[downloader]
recipe = plone.recipe.command
command = rm -r ${html5as:docroot}/*; echo "Hello World!" > ${html5as:docroot}/index.html
# Paths that buildout should consider as being managed by this buildout part.
# These will be removed when buildout (re)installs or removes this part.
location = ${html5as:docroot}
# This section will fail if the command fails.
stop-on-error = true
# If a tarball is passed as a parameter in download url
# it's content will be served by the instance.
# If the parameter is not provided it fallback to the default template
command =
URL={{ parameter_dict['download_url'] or ''}};
if [ -n "$URL" ];
then
${html5as:curl-binary} -Lks $URL | ${html5as:tar-binary} xzv -C ${:location} --strip-components 1;
else
cp ${default_index_html:rendered} ${:location}/;
fi
[downloader]
recipe = plone.recipe.command
......
......@@ -9,6 +9,8 @@ extends =
# In this example we extend needed components for html5as.
../../component/nginx/buildout.cfg
../../component/dash/buildout.cfg
../../component/tar/buildout.cfg
../../component/curl/buildout.cfg
parts =
# Call installation of slapos.cookbook egg defined in stack/slapos.cfg (needed
......@@ -32,6 +34,8 @@ context =
section buildout buildout
key nginx_location nginx:location
key dash_location dash:location
key curl_location curl:location
key tar_location tar:location
key template_nginx_conf_target template_nginx_conf:target
key template_mime_types_target template_mime_types:target
key template_launcher_target template_launcher:target
......
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