Commit a5097012 authored by Thomas Lechauve's avatar Thomas Lechauve

Rewrite html5as software release using jinja2

parent 97bfc5c9
[buildout]
parts =
switch-softwaretype
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[switch-softwaretype]
recipe = slapos.cookbook:softwaretype
......
[buildout]
parts =
html5as
nginx_conf
html5as_bin
website_download
publish-connection-information
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
# partition tree
# /
# |- etc/
# | |- nginx.conf
# | |- run/
# | |- nginx (binary)
# | |- html5as (binary)
# |- var/
# | |- run/
# | | |- nginx.pid
......@@ -19,9 +24,6 @@ parts =
# | |- html5as/ (doc root)
# | | |- index.html
# | |- backup/
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
......@@ -38,22 +40,53 @@ backup = $${rootdirectory:srv}/backup
data = $${rootdirectory:srv}/html5as
[html5as]
recipe = slapos.cookbook:html5as
# Options
nb_workers = 2
# Network
ip = $${slap-network-information:global-ipv6}
port = 8080
# Paths
# Log
path_pid = $${basedirectory:run}/nginx.pid
path_log = $${basedirectory:log}/nginx.log
path_access_log = $${basedirectory:log}/nginx.access.log
path_error_log = $${basedirectory:log}/nginx.error.log
root = $${basedirectory:data}
path_tmp = $${buildout:directory}/tmp
# Docroot
docroot = $${basedirectory:data}
default_index = $${basedirectory:data}/index.html
ip = $${slap-network-information:global-ipv6}
port = 8080
# Config files
path_nginx_conf = $${rootdirectory:etc}/nginx.conf
# Executables
bin_nginx = ${nginx:location}/sbin/nginx
bin_html5as = $${basedirectory:services}/html5as
# Utils
path_shell = ${dash:location}/bin/dash
nginx_path = ${nginx:location}/sbin/nginx
config_file = $${rootdirectory:etc}/nginx.conf
mime_path = $${rootdirectory:etc}/mime.types
path = $${basedirectory:services}/nginx
tmp = $${buildout:directory}/tmp
[website_download]
recipe = hexagonit.recipe.download
# Website tarball
# Hardcoded to easily test
url = http://sheldy.com/~tom/WTF/slapos.tar.gz
destination = $${html5as:docroot}
[nginx_conf]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/templates/nginx_conf.in
rendered = $${html5as:path_nginx_conf}
md5sum = bbca1642a9ef1b189aba2a7724592665
context = section param_html5as html5as
[html5as_bin]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/templates/html5as_bin.in
rendered = $${html5as:bin_html5as}
md5sum = 0ddb3dfbd963819a1666ca47aa37bbc5
context = section param_html5as html5as
umask = 077
[publish-connection-information]
recipe = slapos.cookbook:publish
......
......@@ -7,34 +7,39 @@ extends =
../../component/nginx/buildout.cfg
../../component/dash/buildout.cfg
develop = /opt/slapdev
allow-hosts =
*.nexedi.org
*.python.org
*.sourceforge.net
www.slapos.org
launchpad.net
github.com
alastairs-place.net
www.alittletooquiet.net
parts =
template
dash
nginx
eggs
instance_html5as
[html5as]
template
instance_html5as
[eggs]
recipe = z3c.recipe.scripts
eggs = slapos.cookbook
[template]
# Default template for the instance.
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/template.cfg
#md5sum = 196670999d6b015f48483d2ae6f15fbd
md5sum = 1910981522ff0b3202530733b5e5129e
mode = 0644
[instance_html5as]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance_html5as.cfg
output = ${buildout:directory}/template_html5as.cfg
#md5sum = 4e0a5c24ded8f0e9afa78c2f37377278
md5sum = c0088d6f69e38d512ca85129988b85d6
mode = 0644
[versions]
......
#! {{ param_html5as['path_shell'] }}
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
exec {{ param_html5as['bin_nginx'] }} -c {{ param_html5as['path_nginx_conf'] }}
worker_processes {{ param_html5as['nb_workers'] }};
user nouser nogroup;
pid {{ param_html5as['path_pid'] }};
error_log {{ param_html5as['path_error_log'] }};
events {
worker_connections 1024;
accept_mutex off;
}
http {
#include mime.types;
default_type application/octet-stream;
access_log {{ param_html5as['path_access_log'] }} combined;
index index.html;
server {
listen [{{ param_html5as['ip'] }}]:{{ param_html5as['port'] }};
server_name _;
keepalive_timeout 5;
client_body_temp_path {{ param_html5as['path_tmp'] }}/client_body_temp;
proxy_temp_path {{ param_html5as['path_tmp'] }}/proxy_temp;
fastcgi_temp_path {{ param_html5as['path_tmp'] }}/fastcgi_temp;
uwsgi_temp_path {{ param_html5as['path_tmp'] }}/uwsgi_temp;
scgi_temp_path {{ param_html5as['path_tmp'] }}/scgi_temp;
# path for static files
root {{ param_html5as['docroot'] }};
}
}
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