Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
slapos
Commits
7427d438
Commit
7427d438
authored
Jan 11, 2021
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
html5as: Use Curl and Tar components to download content to be served
parent
ee773e5e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
4 deletions
+26
-4
software/html5as/buildout.hash.cfg
software/html5as/buildout.hash.cfg
+2
-2
software/html5as/instance.cfg.in
software/html5as/instance.cfg.in
+2
-0
software/html5as/instance_html5as.cfg.in
software/html5as/instance_html5as.cfg.in
+18
-2
software/html5as/software.cfg
software/html5as/software.cfg
+4
-0
No files found.
software/html5as/buildout.hash.cfg
View file @
7427d438
...
...
@@ -17,11 +17,11 @@
[template-cfg]
filename = instance.cfg.in
md5sum =
d75185a0cfeced8aa41d51e1b798d9af
md5sum =
9b8dd44e9a802648840a7116dea05b95
[instance_html5as]
_update_hash_filename_ = instance_html5as.cfg.in
md5sum =
9c023bac9fb0db71213c5d31bd6a0b6b
md5sum =
ea736fd96ca62b388e036ae6dbaeb73d
[template_nginx_conf]
_update_hash_filename_ = templates/nginx_conf.in
...
...
software/html5as/instance.cfg.in
View file @
7427d438
...
...
@@ -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 }}
...
...
software/html5as/instance_html5as.cfg.in
View file @
7427d438
...
...
@@ -89,6 +89,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
...
...
@@ -120,10 +122,23 @@ mode = 700
context =
section param_html5as html5as
#
Simple c
ommand to put content in the docroot
#
C
ommand to put content in the docroot
[downloader]
recipe = plone.recipe.command
command = rm -r ${html5as:docroot}/*; cp ${default_index_html:rendered} ${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 =
rm -rf ${html5as:docroot}/*;
URL="${slap-parameter:download_url}";
if [ -n "$URL" ];
then
${html5as:curl-binary} -Lks $URL | ${html5as:tar-binary} xzv -C ${html5as:docroot} --strip-components 1;
else
cp ${default_index_html:rendered} ${html5as:docroot}/;
fi
[default_index_html]
recipe = slapos.recipe.template:jinja2
...
...
@@ -140,3 +155,4 @@ title = Title ${slap-parameter:title}!
[slap-parameter]
title =
download_url =
software/html5as/software.cfg
View file @
7427d438
...
...
@@ -11,6 +11,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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment