"LOG_FILE" => "$home/caldev_django.log",
"MEDIA_ROOT" => "$home/media",
}
- $shell_env = $environment.map |$key, $value| { "$key=$value" }
file { $home:
mode => "0755",
exec { "py-requirements":
cwd => $caldance_app,
user => $user,
- environment => concat(["HOME=${home}"], $shell_env),
+ environment => ["HOME=${home}"],
command => "/usr/bin/sed -i -e '/GDAL/d' requirements.txt && ${home}/virtualenv/bin/pip install -r requirements.txt --upgrade",
require => User["$user:"],
refreshonly => true,
exec { "py-migrate":
cwd => $caldance_app,
user => $user,
- environment => concat(["HOME=${home}"], $shell_env),
- command => "$caldance_app/manage.py migrate",
- require => [User["$user:"], File["$caldance_app/manage.py"]],
+ environment => ["HOME=${home}"],
+ command => "$caldance_app/manage migrate",
+ require => [User["$user:"], File["$caldance_app/manage"]],
refreshonly => true,
} ~>
exec { "py-static":
cwd => $caldance_app,
user => $user,
- environment => concat(["HOME=${home}"], $shell_env),
- command => "$caldance_app/manage.py collectstatic --no-input",
- require => [User["$user:"], File["$caldance_app/manage.py"]],
+ environment => ["HOME=${home}"],
+ command => "$caldance_app/manage collectstatic --no-input",
+ require => [User["$user:"], File["$caldance_app/manage"]],
refreshonly => true,
} ~>
exec { "restart uwsgi application":
file { "$caldance_app/manage.py":
owner => $user,
group => $group,
- mode => "0755",
+ mode => "0644",
content => template("role/caldance/manage.py.erb"),
require => [
User["$user:"],
Archive[ "${home}/caldance_${caldance_version}.tar.gz"],
],
}
+ file { "$caldance_app/manage":
+ owner => $user,
+ group => $group,
+ mode => "0755",
+ content => template("role/caldance/manage.sh.erb"),
+ require => [
+ User["$user:"],
+ Archive[ "${home}/caldance_${caldance_version}.tar.gz"],
+ ],
+ }
file { "$caldance_app/app.ini":
owner => $user,
cron::job { "list_outdated_pip_packages":
ensure => present,
user => $user,
- environment => concat(["HOME=${home}","MAILTO=${mailtos}"], $shell_env),
+ environment => ["HOME=${home}","MAILTO=${mailtos}"],
command => "${home}/virtualenv/bin/pip list --outdated",
minute => "15",
hour => "0",