Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
slapos
Commits
9bd111f4
Commit
9bd111f4
authored
Sep 13, 2015
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hello World: Add jinja template
parent
65d12c03
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
software/helloworld/instance.cfg.in
software/helloworld/instance.cfg.in
+12
-0
software/helloworld/software.cfg
software/helloworld/software.cfg
+8
-0
software/helloworld/template/rendered.in
software/helloworld/template/rendered.in
+7
-0
No files found.
software/helloworld/instance.cfg.in
View file @
9bd111f4
...
...
@@ -9,6 +9,7 @@ parts =
hello-world
hello-world-promise
publish-connection-parameter
render-template
# Define egg directories to be the one from Software Release
# (/opt/slapgrid/...)
...
...
@@ -59,6 +60,7 @@ service = $${:etc}/service
promise = $${:etc}/promise/
# Path of the log directory used by our service (see [hello-world])
log = $${:var}/log
data-fold = $${:home}/srv/data
# Create a simple web server that says "hello <configuration.name>" to the web.
...
...
@@ -97,6 +99,15 @@ path = $${directory:promise}/hello-world
hostname= $${hello-world:ipv6}
port = $${hello-world:port}
[render-template]
recipe = slapos.recipe.template:jinja2
template = ${template-download:location}/${template-download:filename}
rendered = $${directory:data-fold}/data1.txt
#Why 700 specifically for rendered text file ??
mode = 700
context =
key name instance-parameter:configuration.name
key title instance-parameter:configuration.title
# Publish all the parameters needed for the user to connect to the instance.
# It can be anything: URL(s), password(s), or arbitrary parameters.
...
...
@@ -107,3 +118,4 @@ name = Hello $${instance-parameter:configuration.name
# Publishing the title from configuration
title = $${instance-parameter:configuration.title}
url = $${hello-world:url}
path = $${render-template:rendered}
software/helloworld/software.cfg
View file @
9bd111f4
...
...
@@ -34,6 +34,14 @@ output = ${buildout:directory}/instance.cfg
#md5sum = 968bea0fc81dc604a874c53648b7d13f
mode = 0644
# Dowloading helloweb service script in parts which would be later used in service
[template-download]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/template/${:filename}
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = rendered.in
download-only = True
mode = 0644
# install hello-web with correct python_executable
[hello-web-bin]
...
...
software/helloworld/template/rendered.in
0 → 100644
View file @
9bd111f4
{% if title -%}
{{ title }}
{% endif -%}
Hello {{ name }}
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