Skip to content

Commit

Permalink
feat: add run_with_symfony_app_env for extra services
Browse files Browse the repository at this point in the history
  • Loading branch information
AlcaYezzz committed Jul 10, 2024
1 parent cff6be1 commit 32f935e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ steamengine_wrapper_scripts_extra: []
# command:
# run_as_app_user: true # optional
# run_in_project_root_path_web: true # optional
# run_with_symfony_app_env: false # optional

steamengine_wrapper_scripts_post_deploy: []
steamengine_wrapper_scripts_pre_deploy: []
Expand Down
7 changes: 6 additions & 1 deletion templates/steamengine_wrapper.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ while [ $# -gt 0 ]; do
{% if item.run_in_project_root_path_web is defined and item.run_in_project_root_path_web %}
cd {{ steamengine_project_root_path_web }}
{% endif %}
{{ item.command }}
{% if item.run_with_symfony_app_env is defined and item.run_with_symfony_app_env %}
APP_ENV='{{ steamengine_project_configuration.APP_ENV }}' {{ item.command }}
{% else %}
{{ item.command }}
{% endif %}
EOF
exit $?
;;
Expand Down
3 changes: 3 additions & 0 deletions templates/systemd_extra.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Description={{ steamengine_project_name }} {{ item.description }}

[Service]
WorkingDirectory={{ steamengine_project_root_path_web }}
{% if item.run_with_symfony_app_env is defined and item.run_with_symfony_app_env %}
Environment="APP_ENV='{{ steamengine_project_configuration.APP_ENV }}'"
{% endif %}
ExecStart={{ item.command }}

Type=simple
Expand Down

0 comments on commit 32f935e

Please sign in to comment.