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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Titouan Soulard
slapos
Commits
de45e89a
Commit
de45e89a
authored
Jul 13, 2021
by
Lisa Casino
Committed by
Xavier Thompson
Oct 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/html5as-base: switch to slapos.recipe.build
parent
a63c2213
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
33 deletions
+41
-33
software/html5as-base/buildout.hash.cfg
software/html5as-base/buildout.hash.cfg
+3
-3
software/html5as-base/instance.cfg.in
software/html5as-base/instance.cfg.in
+3
-5
software/html5as-base/instance_html5as.cfg.in
software/html5as-base/instance_html5as.cfg.in
+33
-20
software/html5as-base/instance_replicate.cfg.in
software/html5as-base/instance_replicate.cfg.in
+2
-1
software/html5as-base/software.cfg
software/html5as-base/software.cfg
+0
-4
No files found.
software/html5as-base/buildout.hash.cfg
View file @
de45e89a
...
@@ -17,11 +17,11 @@
...
@@ -17,11 +17,11 @@
[template-cfg]
[template-cfg]
filename = instance.cfg.in
filename = instance.cfg.in
md5sum =
ef8a9814d930d61cefb8e0c6e3e1f306
md5sum =
9e486efe4ab1aba8cb72b04f6c6da8ad
[instance_html5as]
[instance_html5as]
_update_hash_filename_ = instance_html5as.cfg.in
_update_hash_filename_ = instance_html5as.cfg.in
md5sum =
a2a9689239fd931fcfa412ffa0e03e2e
md5sum =
f8d1777c43b173a900cfbdf104dec990
[template_nginx_conf]
[template_nginx_conf]
_update_hash_filename_ = templates/nginx_conf.in
_update_hash_filename_ = templates/nginx_conf.in
...
@@ -45,4 +45,4 @@ md5sum = 1c0ee16966e1fcdb3fd11c09f12ee2b2
...
@@ -45,4 +45,4 @@ md5sum = 1c0ee16966e1fcdb3fd11c09f12ee2b2
[template_instance_replicate]
[template_instance_replicate]
_update_hash_filename_ = instance_replicate.cfg.in
_update_hash_filename_ = instance_replicate.cfg.in
md5sum =
2dd03eb194641fbc560122d04b67e212
md5sum =
7ff7e11d05145115f53564ec1af205ef
software/html5as-base/instance.cfg.in
View file @
de45e89a
...
@@ -9,8 +9,6 @@ offline = true
...
@@ -9,8 +9,6 @@ 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 }}
...
@@ -33,8 +31,8 @@ context =
...
@@ -33,8 +31,8 @@ context =
jsonkey default_parameter_dict :default-parameters
jsonkey default_parameter_dict :default-parameters
default-parameters =
default-parameters =
{
{
"title": "
Tutorial html5as
",
"title": "",
"download_url":
""
,
"download_url":
null
,
"port": 8081,
"port": 8081,
"monitor-httpd-port": 8197
"monitor-httpd-port": 8197
}
}
...
@@ -52,7 +50,7 @@ context =
...
@@ -52,7 +50,7 @@ context =
jsonkey default_parameter_dict :default-parameters
jsonkey default_parameter_dict :default-parameters
default-parameters =
default-parameters =
{
{
"download_url":
""
,
"download_url":
null
,
"replicate-quantity": 1
"replicate-quantity": 1
}
}
...
...
software/html5as-base/instance_html5as.cfg.in
View file @
de45e89a
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
[buildout]
[buildout]
parts =
parts =
nginx_conf
nginx_conf
downloader
mime_types
mime_types
launcher
launcher
nginx-graceful
nginx-graceful
...
@@ -62,7 +61,6 @@ service = ${directory:etc}/service
...
@@ -62,7 +61,6 @@ service = ${directory:etc}/service
log = ${directory:var}/log
log = ${directory:var}/log
run = ${directory:var}/run
run = ${directory:var}/run
backup = ${directory:srv}/backup
backup = ${directory:srv}/backup
data = ${directory:srv}/html5as
[tempdirectory]
[tempdirectory]
recipe = slapos.cookbook:mkdirectory
recipe = slapos.cookbook:mkdirectory
...
@@ -92,15 +90,13 @@ path_access_log = ${basedirectory:log}/nginx.access.log
...
@@ -92,15 +90,13 @@ path_access_log = ${basedirectory:log}/nginx.access.log
path_error_log = ${basedirectory:log}/nginx.error.log
path_error_log = ${basedirectory:log}/nginx.error.log
path_tmp = ${tempdirectory:tmp}
path_tmp = ${tempdirectory:tmp}
# Docroot
# Docroot
docroot = ${
basedirectory:data
}
docroot = ${
downloader:location
}
default_index = ${
basedirectory:data
}/index.html
default_index = ${
:docroot
}/index.html
# Config files
# Config files
path_nginx_conf = ${directory:etc}/nginx.conf
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:service}/launcher
bin_launcher = ${basedirectory:service}/launcher
...
@@ -134,23 +130,40 @@ context =
...
@@ -134,23 +130,40 @@ context =
# Command to put content in the docroot
# Command to put content in the docroot
[downloader]
[downloader]
recipe = plone.recipe.command
recipe = slapos.recipe.build
# Paths that buildout should consider as being managed by this buildout part.
# Path where the recipe stores any produced file,
# These will be removed when buildout (re)installs or removes this part.
# it will be automatically removed at the beginning of "install".
location = ${html5as:docroot}
location = ${directory:srv}/html5as
# This section will fail if the command fails.
# All the keys in this section will be available as a dict called "self.options"
stop-on-error = true
# We add: or '', otherwise jinja2 will render a 'None' string
url = {{ parameter_dict['download_url'] or '' }}
default_index_html = ${default_index_html:rendered}
# If a tarball is passed as a parameter in download url
# If a tarball is passed as a parameter in download url
# it's content will be served by the instance.
# it's content will be served by the instance.
# If the parameter is not provided it fallback to the default template
# If the parameter is not provided it fallback to the default template
command =
install =
URL={{ parameter_dict['download_url'] }};
import os, shutil
if [ -n "$URL" ];
buildout_offline = self.buildout['buildout']['offline']
then
try:
${html5as:curl-binary} -Lks $URL | ${html5as:tar-binary} xzv -C ${:location} --strip-components 1;
# Allow to do self.download() which can only be used in "online" mode
else
self.buildout['buildout']['offline'] = 'false'
cp ${default_index_html:rendered} ${:location}/;
if self.options['url']:
fi
# Use fonctions from the slapos.recipe.build repository
# Download a file from a URL to a temporary path
file = self.download(self.options['url'])
# Create a directory and extract the file that are compressed inside
extract_dir = self.extract(file)
# Return the right directory path
workdir = guessworkdir(extract_dir)
# Recursively copy directory
self.copyTree(workdir, location)
else:
# Create directory and copy the default template inside
os.makedirs(location)
shutil.copy(self.options['default_index_html'], location)
finally:
# reset the parameter
self.buildout['buildout']['offline'] = buildout_offline
[default_index_html]
[default_index_html]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
...
...
software/html5as-base/instance_replicate.cfg.in
View file @
de45e89a
...
@@ -31,7 +31,8 @@ software-type = default
...
@@ -31,7 +31,8 @@ software-type = default
# What parameter are neede to be retrieved
# What parameter are neede to be retrieved
return = server_url server-cdn-url monitor-setup-url
return = server_url server-cdn-url monitor-setup-url
# Provided parameters
# Provided parameters
config-download_url = {{ parameter_dict['download_url'] }}
# We add: or '', otherwise jinja2 will render a 'None' string
config-download_url = {{ parameter_dict['download_url'] or '' }}
# Create request section in a loop.
# Create request section in a loop.
{% for i in range(1, replicate_quantity + 1) %}
{% for i in range(1, replicate_quantity + 1) %}
...
...
software/html5as-base/software.cfg
View file @
de45e89a
...
@@ -13,8 +13,6 @@ extends =
...
@@ -13,8 +13,6 @@ 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
...
@@ -38,8 +36,6 @@ context =
...
@@ -38,8 +36,6 @@ 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
...
...
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