Skip to content

Commit

Permalink
Set STATIC_ROOT in settings.py
Browse files Browse the repository at this point in the history
By setting it in settings.py, pulp-manager will also know about it. It
also makes the service file more straight forward.
  • Loading branch information
ekohl committed Sep 14, 2020
1 parent 7098cea commit ae470e0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/classes/pulpcore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@
is_expected.to compile.with_all_deps
is_expected.to contain_file('/my/custom/directory')
is_expected.to contain_systemd__unit_file('pulpcore-api.service')
.with_content(%r{Environment="PULP_STATIC_ROOT=/my/other/custom/directory"})
is_expected.to contain_apache__vhost('pulpcore')
.with_docroot('/my/custom/directory')
is_expected.to contain_concat__fragment('base')
.with_content(%r{MEDIA_ROOT = "/my/custom/directory"})
.with_content(%r{STATIC_ROOT = "/my/other/custom/directory"})
end
end
end
Expand Down
1 change: 0 additions & 1 deletion templates/pulpcore-api.service.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Wants=network-online.target
[Service]
Environment="DJANGO_SETTINGS_MODULE=pulpcore.app.settings"
Environment="PULP_SETTINGS=<%= scope['pulpcore::settings_file'] %>"
Environment="PULP_STATIC_ROOT=<%= scope['pulpcore::pulp_static_root'] %>"
User=<%= scope['pulpcore::user'] %>
PIDFile=/run/pulpcore-api.pid
RuntimeDirectory=pulpcore-api
Expand Down
1 change: 1 addition & 0 deletions templates/settings.py.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ DATABASES = {
},
}
MEDIA_ROOT = "<%= scope['pulpcore::webserver_static_dir'] %>"
STATIC_ROOT = "<%= scope['pulpcore::pulp_static_root'] %>"
REDIS_HOST = "localhost"
REDIS_PORT = "<%= scope['redis::port'] %>"
REDIS_DB = <%= scope['pulpcore::redis_db'] %>
Expand Down

0 comments on commit ae470e0

Please sign in to comment.