diff options
Diffstat (limited to 'nixops/modules/websites/connexionswing/connexionswing.nix')
-rw-r--r-- | nixops/modules/websites/connexionswing/connexionswing.nix | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/nixops/modules/websites/connexionswing/connexionswing.nix b/nixops/modules/websites/connexionswing/connexionswing.nix index 2960c6a..13d4fba 100644 --- a/nixops/modules/websites/connexionswing/connexionswing.nix +++ b/nixops/modules/websites/connexionswing/connexionswing.nix | |||
@@ -33,6 +33,18 @@ let | |||
33 | ''; | 33 | ''; |
34 | }; | 34 | }; |
35 | phpFpm = rec { | 35 | phpFpm = rec { |
36 | preStart = '' | ||
37 | if [ ! -f "${varDir}/currentWebappDir" -o \ | ||
38 | ! -f "${varDir}/currentKey" -o \ | ||
39 | "${webappDir}" != "$(cat ${varDir}/currentWebappDir 2>/dev/null)" ] \ | ||
40 | || ! sha512sum -c --status ${varDir}/currentKey; then | ||
41 | pushd ${webappDir} > /dev/null | ||
42 | /run/wrappers/bin/sudo -u wwwrun ./bin/console --env=${environment} cache:clear --no-warmup | ||
43 | popd > /dev/null | ||
44 | echo -n "${webappDir}" > ${varDir}/currentWebappDir | ||
45 | sha512sum /run/keys/webapps/${environment}-connexionswing > ${varDir}/currentKey | ||
46 | fi | ||
47 | ''; | ||
36 | serviceDeps = [ "mysql.service" "${environment}-connexionswing-key.service" ]; | 48 | serviceDeps = [ "mysql.service" "${environment}-connexionswing-key.service" ]; |
37 | socket = "/var/run/phpfpm/connexionswing-${environment}.sock"; | 49 | socket = "/var/run/phpfpm/connexionswing-${environment}.sock"; |
38 | phpConfig = '' | 50 | phpConfig = '' |
@@ -151,13 +163,6 @@ let | |||
151 | ${varDir}/uploads \ | 163 | ${varDir}/uploads \ |
152 | ${varDir}/var | 164 | ${varDir}/var |
153 | install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions | 165 | install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions |
154 | if [ ! -f "${varDir}/currentWebappDir" -o \ | ||
155 | "${webappDir}" != "$(cat ${varDir}/currentWebappDir 2>/dev/null)" ]; then | ||
156 | pushd ${webappDir} > /dev/null | ||
157 | $wrapperDir/sudo -u wwwrun ./bin/console --env=${environment} cache:clear --no-warmup | ||
158 | popd > /dev/null | ||
159 | echo -n "${webappDir}" > ${varDir}/currentWebappDir | ||
160 | fi | ||
161 | ''; | 166 | ''; |
162 | }; | 167 | }; |
163 | webappDir = composerEnv.buildPackage ( | 168 | webappDir = composerEnv.buildPackage ( |