diff options
Diffstat (limited to 'modules/private/websites/ludivinecassal/builder.nix')
-rw-r--r-- | modules/private/websites/ludivinecassal/builder.nix | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/modules/private/websites/ludivinecassal/builder.nix b/modules/private/websites/ludivinecassal/builder.nix index 3167bce..e2a0f19 100644 --- a/modules/private/websites/ludivinecassal/builder.nix +++ b/modules/private/websites/ludivinecassal/builder.nix | |||
@@ -1,4 +1,4 @@ | |||
1 | { apacheUser, apacheGroup, config, ludivinecassal, pkgs, ruby, sass, imagemagick }: | 1 | { apacheUser, apacheGroup, config, ludivinecassal, mylibs, pkgs, ruby, sass, imagemagick }: |
2 | rec { | 2 | rec { |
3 | app = ludivinecassal.override { inherit (config) environment; }; | 3 | app = ludivinecassal.override { inherit (config) environment; }; |
4 | varDir = "/var/lib/ludivinecassal_${app.environment}"; | 4 | varDir = "/var/lib/ludivinecassal_${app.environment}"; |
@@ -39,18 +39,16 @@ rec { | |||
39 | ''; | 39 | ''; |
40 | }]; | 40 | }]; |
41 | phpFpm = rec { | 41 | phpFpm = rec { |
42 | preStart = '' | 42 | preStart = mylibs.phpFpmPreStart { |
43 | if [ ! -f "${app.varDir}/currentWebappDir" -o \ | 43 | inherit app; |
44 | ! -f "${app.varDir}/currentKey" -o \ | 44 | inherit (app) varDir; |
45 | "${app}" != "$(cat ${app.varDir}/currentWebappDir 2>/dev/null)" ] \ | 45 | keyFiles = [ |
46 | || ! sha512sum -c --status ${app.varDir}/currentKey; then | 46 | "/var/secrets/webapps/${app.environment}-ludivinecassal" |
47 | pushd ${app} > /dev/null | 47 | ]; |
48 | /run/wrappers/bin/sudo -u ${apacheUser} ./bin/console --env=${app.environment} cache:clear --no-warmup | 48 | actions = [ |
49 | popd > /dev/null | 49 | "/run/wrappers/bin/sudo -u ${apacheUser} ./bin/console --env=${app.environment} cache:clear --no-warmup" |
50 | echo -n "${app}" > ${app.varDir}/currentWebappDir | 50 | ]; |
51 | sha512sum /var/secrets/webapps/${app.environment}-ludivinecassal > ${app.varDir}/currentKey | 51 | }; |
52 | fi | ||
53 | ''; | ||
54 | serviceDeps = [ "mysql.service" ]; | 52 | serviceDeps = [ "mysql.service" ]; |
55 | socket = "/var/run/phpfpm/ludivinecassal-${app.environment}.sock"; | 53 | socket = "/var/run/phpfpm/ludivinecassal-${app.environment}.sock"; |
56 | pool = '' | 54 | pool = '' |