bundles/matrix-media-repo: introduce, add to htz.ex42-1048908
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
638e37c05f
commit
d4b110087f
7 changed files with 348 additions and 3 deletions
71
bundles/matrix-media-repo/items.py
Normal file
71
bundles/matrix-media-repo/items.py
Normal file
|
@ -0,0 +1,71 @@
|
|||
directories = {
|
||||
'/opt/matrix-media-repo': {
|
||||
'owner': 'matrix-media-repo',
|
||||
'group': 'matrix-media-repo',
|
||||
},
|
||||
'/opt/matrix-media-repo/src': {
|
||||
'owner': 'matrix-media-repo',
|
||||
'group': 'matrix-media-repo',
|
||||
},
|
||||
'/var/matrix/media': {
|
||||
'owner': 'matrix-media-repo',
|
||||
'group': 'matrix-media-repo',
|
||||
},
|
||||
}
|
||||
|
||||
users = {
|
||||
'matrix-media-repo': {
|
||||
'home': '/opt/matrix-media-repo',
|
||||
},
|
||||
}
|
||||
|
||||
files = {
|
||||
'/opt/matrix-media-repo/config.yaml': {
|
||||
'owner': 'matrix-media-repo',
|
||||
'content_type': 'mako',
|
||||
'triggers': {
|
||||
'svc_systemd:matrix-media-repo:restart',
|
||||
},
|
||||
},
|
||||
'/etc/systemd/system/matrix-media-repo.service': {
|
||||
'triggers': {
|
||||
'action:systemd-reload',
|
||||
'svc_systemd:matrix-media-repo:restart',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
git_deploy = {
|
||||
'/opt/matrix-media-repo/src': {
|
||||
'repo': 'https://github.com/turt2live/matrix-media-repo.git',
|
||||
'rev': node.metadata['matrix-media-repo']['version'],
|
||||
'triggers': {
|
||||
'action:matrix-media-repo_build',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
actions = {
|
||||
'matrix-media-repo_build': {
|
||||
'command': \
|
||||
'chown -R matrix-media-repo:matrix-media-repo /opt/matrix-media-repo/src && ' + \
|
||||
'sudo -u matrix-media-repo bash -c "cd /opt/matrix-media-repo/src && ' + \
|
||||
'GOBIN=/opt/matrix-media-repo/src/bin go install -v ./cmd/compile_assets && ' + \
|
||||
'/opt/matrix-media-repo/src/bin/compile_assets && ' + \
|
||||
'GOBIN=/opt/matrix-media-repo/src/bin go install -ldflags \\\"' + \
|
||||
'-X github.com/turt2live/matrix-media-repo/common/version.GitCommit=$(cat /opt/matrix-media-repo/src/.bundlewrap_git_deploy) ' + \
|
||||
'-X github.com/turt2live/matrix-media-repo/common/version.Version={}\\\" '.format(node.metadata['matrix-media-repo']['version']) + \
|
||||
'-v ./cmd/..."',
|
||||
'triggered': True,
|
||||
},
|
||||
}
|
||||
|
||||
svc_systemd = {
|
||||
'matrix-media-repo': {
|
||||
'needs': {
|
||||
'action:matrix-media-repo_build',
|
||||
'file:/etc/systemd/system/matrix-media-repo.service',
|
||||
'file:/opt/matrix-media-repo/config.yaml',
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue