diff options
Diffstat (limited to 'modules/private/websites/florian/builder_app.nix')
-rw-r--r-- | modules/private/websites/florian/builder_app.nix | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/modules/private/websites/florian/builder_app.nix b/modules/private/websites/florian/builder_app.nix index e521f6e..c12663a 100644 --- a/modules/private/websites/florian/builder_app.nix +++ b/modules/private/websites/florian/builder_app.nix | |||
@@ -1,4 +1,4 @@ | |||
1 | { apacheUser, apacheGroup, tellesflorian, config }: | 1 | { apacheUser, apacheGroup, tellesflorian, mylibs, config }: |
2 | rec { | 2 | rec { |
3 | app = tellesflorian.override { inherit (config) environment; }; | 3 | app = tellesflorian.override { inherit (config) environment; }; |
4 | keys = [ | 4 | keys = [ |
@@ -33,18 +33,16 @@ rec { | |||
33 | } | 33 | } |
34 | ]; | 34 | ]; |
35 | phpFpm = rec { | 35 | phpFpm = rec { |
36 | preStart = '' | 36 | preStart = mylibs.phpFpmPreStart { |
37 | if [ ! -f "${app.varDir}/currentWebappDir" -o \ | 37 | inherit app; |
38 | ! -f "${app.varDir}/currentKey" -o \ | 38 | inherit (app) varDir; |
39 | "${app}" != "$(cat ${app.varDir}/currentWebappDir 2>/dev/null)" ] \ | 39 | keyFiles = [ |
40 | || ! sha512sum -c --status ${app.varDir}/currentKey; then | 40 | "/var/secrets/webapps/${app.environment}-tellesflorian" |
41 | pushd ${app} > /dev/null | 41 | ]; |
42 | /run/wrappers/bin/sudo -u wwwrun ./bin/console --env=${app.environment} cache:clear --no-warmup | 42 | actions = [ |
43 | popd > /dev/null | 43 | "/run/wrappers/bin/sudo -u wwwrun ./bin/console --env=${app.environment} cache:clear --no-warmup" |
44 | echo -n "${app}" > ${app.varDir}/currentWebappDir | 44 | ]; |
45 | sha512sum /var/secrets/webapps/${app.environment}-tellesflorian > ${app.varDir}/currentKey | 45 | }; |
46 | fi | ||
47 | ''; | ||
48 | serviceDeps = [ "mysql.service" ]; | 46 | serviceDeps = [ "mysql.service" ]; |
49 | socket = "/var/run/phpfpm/floriantelles-${app.environment}.sock"; | 47 | socket = "/var/run/phpfpm/floriantelles-${app.environment}.sock"; |
50 | pool = '' | 48 | pool = '' |