Commit 701f7f26 authored by Lisa Casino's avatar Lisa Casino Committed by Xavier Thompson

software/html5as-base: add curl and tar components

parent c401cede
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
[template-cfg] [template-cfg]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 2c36a705be4df9222823af570b29b4c3 md5sum = a91336fabd9f8e8eeb06bb14359f924b
[instance_html5as] [instance_html5as]
_update_hash_filename_ = instance_html5as.cfg.in _update_hash_filename_ = instance_html5as.cfg.in
md5sum = cc9270fa52d55143d4db7f38e38bbd37 md5sum = 1701ea8a81d2c5cd4aaeec029a67b3fa
[template_nginx_conf] [template_nginx_conf]
_update_hash_filename_ = templates/nginx_conf.in _update_hash_filename_ = templates/nginx_conf.in
......
...@@ -9,6 +9,8 @@ offline = true ...@@ -9,6 +9,8 @@ offline = true
[profile-common] [profile-common]
nginx_location = {{ nginx_location }} nginx_location = {{ nginx_location }}
dash_location = {{ dash_location }} dash_location = {{ dash_location }}
tar_location = {{ tar_location }}
curl_location = {{ curl_location }}
template_nginx_conf = {{ template_nginx_conf_target }} 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 }}
...@@ -29,7 +31,8 @@ context = ...@@ -29,7 +31,8 @@ context =
jsonkey default_parameter_dict :default-parameters jsonkey default_parameter_dict :default-parameters
default-parameters = default-parameters =
{ {
"title": "Tutorial html5as" "title": "Tutorial html5as",
"download_url": ""
} }
[switch-softwaretype] [switch-softwaretype]
......
...@@ -93,6 +93,8 @@ path_nginx_conf = ${directory:etc}/nginx.conf ...@@ -93,6 +93,8 @@ path_nginx_conf = ${directory:etc}/nginx.conf
path_mime_types = ${directory:etc}/mime_types path_mime_types = ${directory:etc}/mime_types
# Binaries # Binaries
path_shell = {{ parameter_list['dash_location'] }}/bin/dash 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 # Executables
bin_launcher = ${basedirectory:script}/launcher bin_launcher = ${basedirectory:script}/launcher
...@@ -124,9 +126,25 @@ mode = 700 ...@@ -124,9 +126,25 @@ mode = 700
context = context =
section param_html5as html5as section param_html5as html5as
# Command to put content in the docroot
[downloader] [downloader]
recipe = plone.recipe.command recipe = plone.recipe.command
command = rm -r ${html5as:docroot}/*; cp ${default_index_html:rendered} ${html5as:docroot}/ # 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'] }};
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
[default_index_html] [default_index_html]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
......
...@@ -11,6 +11,8 @@ extends = ...@@ -11,6 +11,8 @@ extends =
# In this example we extend needed components for html5as. # In this example we extend needed components for html5as.
../../component/nginx/buildout.cfg ../../component/nginx/buildout.cfg
../../component/dash/buildout.cfg ../../component/dash/buildout.cfg
../../component/tar/buildout.cfg
../../component/curl/buildout.cfg
parts = parts =
# Call installation of slapos.cookbook egg defined in stack/slapos.cfg (needed # Call installation of slapos.cookbook egg defined in stack/slapos.cfg (needed
...@@ -34,6 +36,8 @@ context = ...@@ -34,6 +36,8 @@ context =
section buildout buildout section buildout buildout
key nginx_location nginx:location key nginx_location nginx:location
key dash_location dash: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_nginx_conf_target template_nginx_conf:target
key template_mime_types_target template_mime_types:target key template_mime_types_target template_mime_types:target
key template_launcher_target template_launcher: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