forked from lab-in-a-box/liab-deployments
This change refactors the first (and simplest) deployment to extract a
high-level operation to deposit a block in a caddyfile. This compound
operation is present in almost any existing deployment, which made it
a good start.
Simultaneously, this is wrapped by a packages deployment
`gitannex_staticwww` that is now cleanly separated from a user-facing
deployment in a specific use case.
Using this deployment, for example to deposit workshop slides would
work with this minimalistic deployment:
```python
from liab_deployments.deploy import gitannex_staticwww
gitannex_staticwww.deploy_repos()
```
and the following, corresponding inventory:
```python
group = [
(
'edu.datalad.org',
# host-specific settings
{
#'caddyfile_path': '/etc/caddy/Caddyfile',
#'caddy_user': ('caddy', 'caddy'),
'gitannex_staticwww': {
'repos': [
{
'serve_address': 'slides.edu.datalad.org',
'fetch_url': 'https://hub.datalad.org/edu/slides.git',
'target_dir': '/var/www/slides.edu.datalad.org',
},
],
},
},
),
]
```
Not shown here is that it is also possible to override the caddyfile
block template.
0 lines
Python
0 lines
Python