Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.recipe.build
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
Thomas Leymonerie
slapos.recipe.build
Commits
3b375acb
Commit
3b375acb
authored
3 years ago
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
README: add a minimal test for slapos.recipe.build default recipe
parent
9eb7ea7f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
README.rst
README.rst
+65
-0
No files found.
README.rst
View file @
3b375acb
...
@@ -48,6 +48,71 @@ Using the init option::
...
@@ -48,6 +48,71 @@ Using the init option::
[section-two]
[section-two]
bar = ${section-one:foo}
bar = ${section-one:foo}
A simplified example::
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... parts = section-two
...
... [section-one]
... recipe = slapos.recipe.build
... init =
... options['foo'] = 'foo from section-one'
...
... [section-two]
... recipe = slapos.recipe.build
... bar = ${section-one:foo}
... install =
... import os
... os.mkdir(options['location'])
... print('Installed section-two with option %s.' % options['bar'])
... """)
>>> print(system(buildout))
Installing section-one.
Installing section-two.
Installed section-two with option foo from section-one.
...
>>> ls(sample_buildout, 'parts')
d section-two
In case of error, a proper traceback is displayed and nothing is installed
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... parts = section-two
...
... [section-two]
... recipe = slapos.recipe.build
... install =
... import os
... os.mkdir(options['location'])
... print(1 / 0.) # this is an error !
... """)
>>> print(system(buildout))
Uninstalling section-two.
Uninstalling section-one.
Installing section-two.
...
While:
Installing section-two.
<BLANKLINE>
An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
...
File "<string>", line 3, in <module>
ZeroDivisionError: float division by zero
>>> ls(sample_buildout, 'parts')
<BLANKLINE>
Pure download
Pure download
~~~~~~~~~~~~~
~~~~~~~~~~~~~
...
...
This diff is collapsed.
Click to expand it.
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