]>
Commit | Line | Data |
---|---|---|
52e8779d IB |
1 | { environment ? "prod" |
2 | , varDir ? "/var/lib/connexionswing_${environment}" | |
d3452fc5 | 3 | , secretsPath ? "/var/secrets/webapps/${environment}-connexionswing" |
52e8779d IB |
4 | , composerEnv, fetchurl, fetchgit, mylibs }: |
5 | let | |
6 | app = composerEnv.buildPackage ( | |
7 | import ./php-packages.nix { inherit composerEnv fetchurl fetchgit; } // | |
8 | mylibs.fetchedGitPrivate ./connexionswing.json // | |
9 | rec { | |
10 | noDev = (environment == "prod"); | |
11 | preInstall = '' | |
12 | export SYMFONY_ENV="${environment}" | |
13 | ''; | |
14 | postInstall = '' | |
15 | cd $out | |
16 | ${if environment == "prod" then "php ./bin/console assetic:dump --env=prod --no-debug" else ""} | |
17 | rm app/config/parameters.yml | |
d3452fc5 | 18 | ln -sf ${secretsPath} app/config/parameters.yml |
52e8779d IB |
19 | rm -rf var/{logs,cache} |
20 | ln -sf ${varDir}/var/{logs,cache} var/ | |
21 | ln -sf ${varDir}/{medias,uploads} web/images/ | |
22 | ''; | |
23 | passthru = { | |
24 | inherit varDir environment; | |
25 | webRoot = "${app}/web"; | |
26 | }; | |
27 | }); | |
28 | in app |