binary deployment of twirre.me rust rewrite
This commit is contained in:
7
roles/binary_app/templates/binary-app.env.j2
Normal file
7
roles/binary_app/templates/binary-app.env.j2
Normal file
@@ -0,0 +1,7 @@
|
||||
{% set app_vault_env_var = 'vault_' + (binary_app.name | replace('-', '_')) + '_env' %}
|
||||
{% set app_vault_env = lookup('vars', app_vault_env_var, default={}) %}
|
||||
{% set app_non_vault_env_keys = binary_app.non_vault_env_keys | default([]) %}
|
||||
{% set app_filtered_vault_env = app_vault_env | dict2items | rejectattr('key', 'in', app_non_vault_env_keys) | items2dict %}
|
||||
{% for key, value in (binary_app.env | combine(app_filtered_vault_env)) | dictsort %}
|
||||
{{ key }}={{ value }}
|
||||
{% endfor %}
|
||||
17
roles/binary_app/templates/binary-app.service.j2
Normal file
17
roles/binary_app/templates/binary-app.service.j2
Normal file
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description={{ binary_app.name }} binary service
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User={{ binary_app.deploy_user }}
|
||||
Group={{ binary_app.deploy_group }}
|
||||
WorkingDirectory={{ binary_app.working_directory | default(binary_app_current_path) }}
|
||||
EnvironmentFile=/etc/{{ binary_app.name }}/app.env
|
||||
ExecStart={{ binary_app_current_path }}/{{ binary_app_binary_path }}
|
||||
Restart=always
|
||||
RestartSec=1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user