Revert "Move the environment variables to an EnvironmentFile"
This reverts commit 79023a65f24b86a3fd357a3db7d3cb60e34852a9.
This commit is contained in:
parent
ecf5870195
commit
f5051d6352
@ -41,7 +41,6 @@ user deploy_user do
|
||||
end
|
||||
|
||||
path_to_deploy = "/opt/#{app_name}"
|
||||
environment_file = "/home/deploy/.kredits-github_environment"
|
||||
application path_to_deploy do
|
||||
owner deploy_user
|
||||
group deploy_group
|
||||
@ -67,22 +66,6 @@ application path_to_deploy do
|
||||
owner deploy_user
|
||||
group deploy_group
|
||||
mode '0440'
|
||||
sensitive true
|
||||
end
|
||||
|
||||
env = {
|
||||
'LOG_LEVEL' => "info",
|
||||
'APP_ID' => credentials['app_id'],
|
||||
'PRIVATE_KEY_PATH' => "#{path_to_deploy}/github_app_key.pem",
|
||||
'WEBHOOK_SECRET' => credentials['webhook_secret'],
|
||||
}
|
||||
|
||||
file environment_file do
|
||||
content env.sort.map {|k, v| "#{k}=#{v}" }.join("\n")
|
||||
owner deploy_user
|
||||
owner deploy_group
|
||||
mode '0440'
|
||||
sensitive true
|
||||
end
|
||||
|
||||
template "/lib/systemd/system/#{app_name}.service" do
|
||||
@ -95,7 +78,12 @@ application path_to_deploy do
|
||||
group: deploy_group,
|
||||
app_dir: path_to_deploy,
|
||||
entry: "/usr/bin/node /usr/bin/npm start",
|
||||
environment_file: environment_file
|
||||
environment: {
|
||||
'LOG_LEVEL' => "info",
|
||||
'APP_ID' => credentials['app_id'],
|
||||
'PRIVATE_KEY_PATH' => "#{path_to_deploy}/github_app_key.pem",
|
||||
'WEBHOOK_SECRET' => credentials['webhook_secret'],
|
||||
}
|
||||
)
|
||||
notifies :run, "execute[systemctl daemon-reload]", :delayed
|
||||
notifies :restart, "service[#{app_name}]", :delayed
|
||||
|
@ -6,7 +6,9 @@ ExecStart=<%= @entry %>
|
||||
WorkingDirectory=<%= @app_dir %>
|
||||
User=<%= @user %>
|
||||
Group=<%= @group %>
|
||||
EnvironmentFile=<%= @environment_file %>
|
||||
<% unless @environment.empty? -%>
|
||||
Environment=<% @environment.each do |key, value| -%>'<%= key %>=<%= value %>' <% end %>
|
||||
<% end -%>
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
|
Loading…
x
Reference in New Issue
Block a user