[Checkins] SVN: zc.recipe.deployment/trunk/ add cache-directory and lib-directory settings
Fred Drake
cvs-admin at zope.org
Thu Mar 7 02:18:20 UTC 2013
Log message for revision 130056:
add cache-directory and lib-directory settings
Changed:
U zc.recipe.deployment/trunk/CHANGES.txt
U zc.recipe.deployment/trunk/README.txt
U zc.recipe.deployment/trunk/src/zc/recipe/deployment/__init__.py
U zc.recipe.deployment/trunk/src/zc/recipe/deployment/paths.txt
-=-
Modified: zc.recipe.deployment/trunk/CHANGES.txt
===================================================================
--- zc.recipe.deployment/trunk/CHANGES.txt 2013-03-07 01:58:02 UTC (rev 130055)
+++ zc.recipe.deployment/trunk/CHANGES.txt 2013-03-07 02:18:19 UTC (rev 130056)
@@ -12,6 +12,9 @@
``log`` and ``run`` settings. Final (absolute) versions of these
paths are always exported in the output.
+- Add ``cache-directory`` and ``lib-directory`` to the set of output
+ directories.
+
- Consistently refuse to clobber the *-directory outputs; join with
prefix if relative.
Modified: zc.recipe.deployment/trunk/README.txt
===================================================================
--- zc.recipe.deployment/trunk/README.txt 2013-03-07 01:58:02 UTC (rev 130055)
+++ zc.recipe.deployment/trunk/README.txt 2013-03-07 02:18:19 UTC (rev 130056)
@@ -11,6 +11,11 @@
sets or reads options that can be read by other programs to find out
where to place files:
+cache-directory
+ The name of the directory where application instances should write
+ cached copies of replacable data. This is /var/cache/NAME, where
+ NAME is the deployment name.
+
crontab-directory
The name of the directory in which cron jobs should be placed.
This is /etc/cron.d.
@@ -20,6 +25,11 @@
placed. This is /etc/NAME, where NAME is the deployment
name.
+lib-directory
+ The name of the directory where application instances should write
+ valuable data. This is /var/lib/NAME, where NAME is
+ the deployment name.
+
log-directory
The name of the directory where application instances should write
their log files. This is /var/log/NAME, where NAME is
Modified: zc.recipe.deployment/trunk/src/zc/recipe/deployment/__init__.py
===================================================================
--- zc.recipe.deployment/trunk/src/zc/recipe/deployment/__init__.py 2013-03-07 01:58:02 UTC (rev 130055)
+++ zc.recipe.deployment/trunk/src/zc/recipe/deployment/__init__.py 2013-03-07 02:18:19 UTC (rev 130056)
@@ -61,11 +61,15 @@
options['etc-prefix'] = etc
options['var-prefix'] = var
+ # /etc hierarchy
directory('crontab', etc, 'cron.d')
directory('etc', etc, name)
directory('logrotate', etc, 'logrotate.d')
directory('rc', etc, 'init.d')
+ # /var hierarchy
+ directory('cache', var, 'cache', name)
+ directory('lib', var, 'lib', name)
directory('log', log, name)
directory('run', run, name)
Modified: zc.recipe.deployment/trunk/src/zc/recipe/deployment/paths.txt
===================================================================
--- zc.recipe.deployment/trunk/src/zc/recipe/deployment/paths.txt 2013-03-07 01:58:02 UTC (rev 130055)
+++ zc.recipe.deployment/trunk/src/zc/recipe/deployment/paths.txt 2013-03-07 02:18:19 UTC (rev 130056)
@@ -20,9 +20,11 @@
Deployment-specific directories are created based on the name of the part:
>>> compute({})
- {'crontab-directory': '/etc/cron.d',
+ {'cache-directory': '/var/cache/myapp',
+ 'crontab-directory': '/etc/cron.d',
'etc-directory': '/etc/myapp',
'etc-prefix': '/etc',
+ 'lib-directory': '/var/lib/myapp',
'log-directory': '/var/log/myapp',
'logrotate-directory': '/etc/logrotate.d',
'name': 'myapp',
@@ -34,9 +36,11 @@
The ``name`` setting overrides the part name if present and non-empty:
>>> compute({"name": ""})
- {'crontab-directory': '/etc/cron.d',
+ {'cache-directory': '/var/cache/myapp',
+ 'crontab-directory': '/etc/cron.d',
'etc-directory': '/etc/myapp',
'etc-prefix': '/etc',
+ 'lib-directory': '/var/lib/myapp',
'log-directory': '/var/log/myapp',
'logrotate-directory': '/etc/logrotate.d',
'name': 'myapp',
@@ -46,9 +50,11 @@
'var-prefix': '/var'}
>>> compute({"name": "yourapp"})
- {'crontab-directory': '/etc/cron.d',
+ {'cache-directory': '/var/cache/yourapp',
+ 'crontab-directory': '/etc/cron.d',
'etc-directory': '/etc/yourapp',
'etc-prefix': '/etc',
+ 'lib-directory': '/var/lib/yourapp',
'log-directory': '/var/log/yourapp',
'logrotate-directory': '/etc/logrotate.d',
'name': 'yourapp',
@@ -61,9 +67,11 @@
specified hierarchy:
>>> compute({"prefix": "/usr/local"})
- {'crontab-directory': '/usr/local/etc/cron.d',
+ {'cache-directory': '/usr/local/var/cache/myapp',
+ 'crontab-directory': '/usr/local/etc/cron.d',
'etc-directory': '/usr/local/etc/myapp',
'etc-prefix': '/usr/local/etc',
+ 'lib-directory': '/usr/local/var/lib/myapp',
'log-directory': '/usr/local/var/log/myapp',
'logrotate-directory': '/usr/local/etc/logrotate.d',
'name': 'myapp',
@@ -80,10 +88,12 @@
... "log": "/log/someplace",
... "prefix": "/usr/local",
... "run": "/run/someplace"})
- {'crontab-directory': '/antsy/cron.d',
+ {'cache-directory': '/usr/local/var/cache/myapp',
+ 'crontab-directory': '/antsy/cron.d',
'etc': '/antsy',
'etc-directory': '/antsy/myapp',
'etc-prefix': '/antsy',
+ 'lib-directory': '/usr/local/var/lib/myapp',
'log': '/log/someplace',
'log-directory': '/log/someplace/myapp',
'logrotate-directory': '/antsy/logrotate.d',
@@ -100,10 +110,12 @@
>>> compute({"etc": "antsy",
... "log": "var/someplace",
... "prefix": "/usr/local"})
- {'crontab-directory': '/usr/local/antsy/cron.d',
+ {'cache-directory': '/usr/local/var/cache/myapp',
+ 'crontab-directory': '/usr/local/antsy/cron.d',
'etc': 'antsy',
'etc-directory': '/usr/local/antsy/myapp',
'etc-prefix': '/usr/local/antsy',
+ 'lib-directory': '/usr/local/var/lib/myapp',
'log': 'var/someplace',
'log-directory': '/usr/local/var/someplace/myapp',
'logrotate-directory': '/usr/local/antsy/logrotate.d',
@@ -116,19 +128,23 @@
Output options ending in '-directory' can be specified directly; these
values will be retained instead of being clobbered by computed values:
- >>> compute({"crontab-directory": "/my-crontabs",
+ >>> compute({"cache-directory": "/cache-data",
+ ... "crontab-directory": "/my-crontabs",
... "etc": "antsy",
... "etc-directory": "/apps/config",
+ ... "lib-directory": "/big-disk/blobs",
... "log": "var/someplace",
... "log-directory": "/big-disk/full-of-logs",
... "logrotate-directory": "/my-logrotations",
... "prefix": "/usr/local",
... "rc-directory": "/my-rcs",
... "run-directory": "/variable/run-away"})
- {'crontab-directory': '/my-crontabs',
+ {'cache-directory': '/cache-data',
+ 'crontab-directory': '/my-crontabs',
'etc': 'antsy',
'etc-directory': '/apps/config',
'etc-prefix': '/usr/local/antsy',
+ 'lib-directory': '/big-disk/blobs',
'log': 'var/someplace',
'log-directory': '/big-disk/full-of-logs',
'logrotate-directory': '/my-logrotations',
@@ -146,9 +162,11 @@
``prefix`` is relative:
>>> compute({"prefix": "my/prefix"})
- {'crontab-directory': '/my/prefix/etc/cron.d',
+ {'cache-directory': '/my/prefix/var/cache/myapp',
+ 'crontab-directory': '/my/prefix/etc/cron.d',
'etc-directory': '/my/prefix/etc/myapp',
'etc-prefix': '/my/prefix/etc',
+ 'lib-directory': '/my/prefix/var/lib/myapp',
'log-directory': '/my/prefix/var/log/myapp',
'logrotate-directory': '/my/prefix/etc/logrotate.d',
'name': 'myapp',
@@ -163,10 +181,12 @@
... "logrotate-directory": "my-logrotations",
... "prefix": "my/prefix",
... "rc-directory": "my-rcs"})
- {'crontab-directory': '/my/prefix/my-crontabs',
+ {'cache-directory': '/my/prefix/var/cache/myapp',
+ 'crontab-directory': '/my/prefix/my-crontabs',
'etc': 'antsy',
'etc-directory': '/my/prefix/antsy/myapp',
'etc-prefix': '/my/prefix/antsy',
+ 'lib-directory': '/my/prefix/var/lib/myapp',
'log': 'var/someplace',
'log-directory': '/my/prefix/var/someplace/myapp',
'logrotate-directory': '/my/prefix/my-logrotations',
@@ -185,9 +205,11 @@
``etc-prefix`` and ``var-prefix`` settings.
>>> compute({"etc-prefix": "/config"})
- {'crontab-directory': '/config/cron.d',
+ {'cache-directory': '/var/cache/myapp',
+ 'crontab-directory': '/config/cron.d',
'etc-directory': '/config/myapp',
'etc-prefix': '/config',
+ 'lib-directory': '/var/lib/myapp',
'log-directory': '/var/log/myapp',
'logrotate-directory': '/config/logrotate.d',
'name': 'myapp',
@@ -197,9 +219,11 @@
'var-prefix': '/var'}
>>> compute({"var-prefix": "/giant-disk"})
- {'crontab-directory': '/etc/cron.d',
+ {'cache-directory': '/giant-disk/cache/myapp',
+ 'crontab-directory': '/etc/cron.d',
'etc-directory': '/etc/myapp',
'etc-prefix': '/etc',
+ 'lib-directory': '/giant-disk/lib/myapp',
'log-directory': '/giant-disk/log/myapp',
'logrotate-directory': '/etc/logrotate.d',
'name': 'myapp',
@@ -212,9 +236,11 @@
>>> compute({"etc-prefix": "config",
... "prefix": "/alt"})
- {'crontab-directory': '/alt/config/cron.d',
+ {'cache-directory': '/alt/var/cache/myapp',
+ 'crontab-directory': '/alt/config/cron.d',
'etc-directory': '/alt/config/myapp',
'etc-prefix': '/alt/config',
+ 'lib-directory': '/alt/var/lib/myapp',
'log-directory': '/alt/var/log/myapp',
'logrotate-directory': '/alt/config/logrotate.d',
'name': 'myapp',
@@ -225,9 +251,11 @@
>>> compute({"var-prefix": "giant-disk",
... "prefix": "/alt"})
- {'crontab-directory': '/alt/etc/cron.d',
+ {'cache-directory': '/alt/giant-disk/cache/myapp',
+ 'crontab-directory': '/alt/etc/cron.d',
'etc-directory': '/alt/etc/myapp',
'etc-prefix': '/alt/etc',
+ 'lib-directory': '/alt/giant-disk/lib/myapp',
'log-directory': '/alt/giant-disk/log/myapp',
'logrotate-directory': '/alt/etc/logrotate.d',
'name': 'myapp',
@@ -241,10 +269,12 @@
>>> compute({"etc": "/old",
... "etc-prefix": "/config"})
- {'crontab-directory': '/config/cron.d',
+ {'cache-directory': '/var/cache/myapp',
+ 'crontab-directory': '/config/cron.d',
'etc': '/old',
'etc-directory': '/config/myapp',
'etc-prefix': '/config',
+ 'lib-directory': '/var/lib/myapp',
'log-directory': '/var/log/myapp',
'logrotate-directory': '/config/logrotate.d',
'name': 'myapp',
@@ -259,9 +289,11 @@
>>> compute({"log": "/log/someplace",
... "run": "/run/someplace",
... "var-prefix": "/big-disk"})
- {'crontab-directory': '/etc/cron.d',
+ {'cache-directory': '/big-disk/cache/myapp',
+ 'crontab-directory': '/etc/cron.d',
'etc-directory': '/etc/myapp',
'etc-prefix': '/etc',
+ 'lib-directory': '/big-disk/lib/myapp',
'log': '/log/someplace',
'log-directory': '/big-disk/log/myapp',
'logrotate-directory': '/etc/logrotate.d',
More information about the checkins
mailing list