aboutsummaryrefslogtreecommitdiff
path: root/nixops/modules/websites/aten/aten.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixops/modules/websites/aten/aten.nix')
-rw-r--r--nixops/modules/websites/aten/aten.nix19
1 files changed, 12 insertions, 7 deletions
diff --git a/nixops/modules/websites/aten/aten.nix b/nixops/modules/websites/aten/aten.nix
index 6059eb6..567dcd1 100644
--- a/nixops/modules/websites/aten/aten.nix
+++ b/nixops/modules/websites/aten/aten.nix
@@ -4,6 +4,18 @@ let
4 environment = config.environment; 4 environment = config.environment;
5 varDir = "/var/lib/aten_${environment}"; 5 varDir = "/var/lib/aten_${environment}";
6 phpFpm = rec { 6 phpFpm = rec {
7 preStart = ''
8 if [ ! -f "${varDir}/currentWebappDir" -o \
9 ! -f "${varDir}/currentKey" -o \
10 "${webappDir}" != "$(cat ${varDir}/currentWebappDir 2>/dev/null)" ] \
11 || ! sha512sum -c --status ${varDir}/currentKey; then
12 pushd ${webappDir} > /dev/null
13 /run/wrappers/bin/sudo -u wwwrun APP_ENV=${environment} ./bin/console --env=${environment} cache:clear --no-warmup
14 popd > /dev/null
15 echo -n "${webappDir}" > ${varDir}/currentWebappDir
16 sha512sum /run/keys/webapps/${environment}-aten > ${varDir}/currentKey
17 fi
18 '';
7 serviceDeps = [ "postgresql.service" "${environment}-aten-key.service" ]; 19 serviceDeps = [ "postgresql.service" "${environment}-aten-key.service" ];
8 socket = "/var/run/phpfpm/aten-${environment}.sock"; 20 socket = "/var/run/phpfpm/aten-${environment}.sock";
9 pool = '' 21 pool = ''
@@ -90,13 +102,6 @@ let
90 text = '' 102 text = ''
91 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} 103 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir}
92 install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions 104 install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions
93 if [ ! -f "${varDir}/currentWebappDir" -o \
94 "${webappDir}" != "$(cat ${varDir}/currentWebappDir 2>/dev/null)" ]; then
95 pushd ${webappDir} > /dev/null
96 $wrapperDir/sudo -u wwwrun APP_ENV=${environment} ./bin/console --env=${environment} cache:clear --no-warmup
97 popd > /dev/null
98 echo -n "${webappDir}" > ${varDir}/currentWebappDir
99 fi
100 ''; 105 '';
101 }; 106 };
102 yarnModules = let 107 yarnModules = let