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
Xiaowu Zhang
slapos
Commits
0252a737
Commit
0252a737
authored
Jun 02, 2022
by
Thomas Leymonerie
Browse files
Options
Browse Files
Download
Plain Diff
Generic instance macro
See merge request
nexedi/slapos!1177
parents
b1615a7d
844169f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
22 deletions
+28
-22
component/macros/virtual-env.cfg
component/macros/virtual-env.cfg
+23
-2
software/django-dev/software.cfg
software/django-dev/software.cfg
+5
-20
No files found.
component/macros/virtual-env.cfg
View file @
0252a737
...
@@ -4,11 +4,12 @@ extends =
...
@@ -4,11 +4,12 @@ extends =
[virtual-env-base]
[virtual-env-base]
recipe = slapos.recipe.build
recipe = slapos.recipe.build
_name = ${:_buildout_section_name_}
name = ${:_buildout_section_name_}
default-instance = true
init =
init =
from zc.buildout.easy_install import working_set
from zc.buildout.easy_install import working_set
import os
import os
name = options['
_
name']
name = options['name']
eggs = options['eggs']
eggs = options['eggs']
try:
try:
scripts = "scripts = " + options['scripts']
scripts = "scripts = " + options['scripts']
...
@@ -25,6 +26,26 @@ init =
...
@@ -25,6 +26,26 @@ init =
<= python-interpreter
<= python-interpreter
eggs += %(eggs)s
eggs += %(eggs)s
""" % locals())
""" % locals())
if is_true(options.get('default-instance')):
cookbook = "{slapos-cookbook:recipe}"
self.buildout.parse("""
[.%(name)s.instance]
recipe = slapos.recipe.template
output = ${buildout:directory}/instance.cfg
depends = $%(cookbook)s
inline =
[buildout]
parts = publish
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
[publish]
recipe = slapos.cookbook:publish
activate-script = %(location)s
""" % locals())
install =
install =
with open(location, "w") as f:
with open(location, "w") as f:
f.write(options['template'] % {
f.write(options['template'] % {
...
...
software/django-dev/software.cfg
View file @
0252a737
[buildout]
[buildout]
extends =
extends =
../../stack/slapos.cfg
../../stack/slapos.cfg
../../component/macros/virtual-env.cfg
../../component/macros/virtual-env.cfg
parts =
parts =
instance
django-env
slapos-cookbook
[python]
part = python3
[django-env]
[django-env]
<= virtual-env-base
<= virtual-env-base
location = ${buildout:directory}/activate
location = ${buildout:directory}/activate
eggs = Django
eggs = Django
[instance]
[python]
recipe = slapos.recipe.template
part = python3
output = ${buildout:directory}/instance.cfg
inline =
[buildout]
parts = publish
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
[publish]
recipe = slapos.cookbook:publish
activate-script = ${django-env:location}
[versions]
[versions]
Django = 3.2.12
Django = 3.2.12
...
...
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