htz.ex42-1048908: can haz travelynx?
Some checks failed
bundlewrap/pipeline/head There was a failure building this commit
Some checks failed
bundlewrap/pipeline/head There was a failure building this commit
This commit is contained in:
parent
20f3f566ac
commit
0dd2a4b985
5 changed files with 188 additions and 0 deletions
73
bundles/travelynx/items.py
Normal file
73
bundles/travelynx/items.py
Normal file
|
@ -0,0 +1,73 @@
|
|||
pkg_apt = {
|
||||
'perl': {},
|
||||
'cpanminus': {},
|
||||
}
|
||||
|
||||
directories = {
|
||||
'/var/cache/travelynx': {
|
||||
'owner': 'travelynx',
|
||||
'mode': '0700',
|
||||
},
|
||||
}
|
||||
|
||||
files = {
|
||||
'/etc/systemd/system/travelynx.service': {
|
||||
'triggers': {
|
||||
'action:systemd-reload',
|
||||
},
|
||||
},
|
||||
'/opt/travelynx/travelynx.conf': {
|
||||
'content_type': 'mako',
|
||||
'context': node.metadata['travelynx'],
|
||||
'needs': {
|
||||
'git_deploy:/opt/travelynx',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
git_deploy = {
|
||||
'/opt/travelynx': {
|
||||
'repo': 'https://git.finalrewind.org/travelynx',
|
||||
'rev': '1.16.1',
|
||||
'triggers': {
|
||||
'action:travelynx_install_deps',
|
||||
'action:travelynx_database_migrate',
|
||||
'svc_systemd:travelynx:restart',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
actions = {
|
||||
'travelynx_install_deps': {
|
||||
'command': 'cd /opt/travelynx && cpanm -in --no-man-pages --installdeps .',
|
||||
'needs': {
|
||||
'pkg_apt:perl',
|
||||
'pkg_apt:cpanminus',
|
||||
},
|
||||
'triggered': True,
|
||||
},
|
||||
'travelynx_database_migrate': {
|
||||
'command': 'cd /opt/travelynx && perl index.pl database migrate',
|
||||
# Because git_deploy does not put .git onto the server, the script
|
||||
# will complain on STDERR about not finding a git repository.
|
||||
# That's why we need to redirect stderr to /dev/null.
|
||||
'unless': 'cd /opt/travelynx && [ $(perl index.pl database has-current-schema 2>/dev/null) = "yes" ]',
|
||||
'needs': {
|
||||
'action:travelynx_install_deps',
|
||||
'file:/opt/travelynx/travelynx.conf',
|
||||
'postgres_db:travelynx',
|
||||
'postgres_role:travelynx',
|
||||
},
|
||||
'triggered': True,
|
||||
},
|
||||
}
|
||||
|
||||
svc_systemd = {
|
||||
'travelynx': {
|
||||
'needs': {
|
||||
'file:/etc/systemd/system/travelynx.service',
|
||||
'action:travelynx_database_migrate',
|
||||
'directory:/var/cache/travelynx',
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue