2021-02-12 15:01:35 +00:00
|
|
|
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',
|
2021-03-05 06:21:23 +00:00
|
|
|
'svc_systemd:matrix-media-repo:restart',
|
2021-02-12 15:01:35 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
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',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|