feat(ds-fr): Correctly apply patches

This commit is contained in:
Tom Hubrecht 2023-11-30 19:59:19 +01:00
parent 0b41aeaf01
commit 441702b5e5
3 changed files with 27 additions and 62 deletions

View file

@ -20,13 +20,6 @@ in {
# S3 storage setup # S3 storage setup
ACTIVE_STORAGE_SERVICE = "local"; ACTIVE_STORAGE_SERVICE = "local";
S3_ENDPOINT = "https://s3.dgnum.eu";
S3_BUCKET = "demarches-dgnum";
S3_REGION = "garage";
S3_FORCE_PATH_STYLE = "true";
S3_ACCESS_KEY_ID = "GK4d244118eac2336ae0ab2dd9";
S3_SECRET_ACCESS_KEY =
"61100261fb0a0c861371596f9ffcd1e83134301a6d0c665a077135af04ba18c3";
# SAML_IDP_ENABLED = "enabled"; # SAML_IDP_ENABLED = "enabled";

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchpatch, fetchFromGitHub, fetchYarnDeps, yarn, fixup_yarn_lock { lib, stdenv, fetchFromGitHub, git, fetchYarnDeps, yarn, fixup_yarn_lock
, nodejs, ruby_3_2, bundlerEnv, logDir ? "/var/log/ds-fr" , nodejs, ruby_3_2, bundlerEnv, logDir ? "/var/log/ds-fr"
, dataDir ? "/var/lib/ds-fr", initialDeploymentDate ? "17941030" }: , dataDir ? "/var/lib/ds-fr", initialDeploymentDate ? "17941030" }:
@ -51,7 +51,10 @@ let
patches = [ patches = [
# Disable functionnalities as we only precompile assets # Disable functionnalities as we only precompile assets
./patches/build.patch ./patches/build.patch
] ++ dgn-patches; ];
postPatch = builtins.concatStringsSep "\n"
(builtins.map (p: "${git}/bin/git apply -p1 < ${p}") dgn-patches);
OTP_SECRET_KEY = "precompile_placeholder"; OTP_SECRET_KEY = "precompile_placeholder";
SECRET_KEY_BASE = "precompile_placeholder"; SECRET_KEY_BASE = "precompile_placeholder";
@ -78,10 +81,7 @@ let
''; '';
}; };
dgn-patches = import ./dgnum.nix { dgn-patches = import ./dgnum.nix { };
inherit fetchpatch;
inherit (lib) fakeHash;
};
in stdenv.mkDerivation { in stdenv.mkDerivation {
name = "demarches-simplifiees.fr-${version}"; name = "demarches-simplifiees.fr-${version}";
@ -97,7 +97,10 @@ in stdenv.mkDerivation {
./patches/garage.patch ./patches/garage.patch
./patches/secrets-fc.patch ./patches/secrets-fc.patch
./patches/uninterlace_png.patch ./patches/uninterlace_png.patch
] ++ dgn-patches; ];
postPatch = builtins.concatStringsSep "\n"
(builtins.map (p: "${git}/bin/git apply -p1 < ${p}") dgn-patches);
buildPhase = '' buildPhase = ''
rm -rf public rm -rf public

View file

@ -1,59 +1,28 @@
{ fetchpatch, fakeHash }: _:
builtins.map ({ id, hash ? fakeHash }: builtins.map (id:
fetchpatch { builtins.fetchurl
url = "https://git.dgnum.eu/DGNum/demarches-normaliennes/commit/${id}.patch") [
"https://git.dgnum.eu/DGNum/demarches-normaliennes/commit/${id}.patch";
inherit hash;
}) [
# remplacement l'arrache de quelques logos vers versions DGNum # remplacement l'arrache de quelques logos vers versions DGNum
{ "05d34a880ebb34265ebbcac0a83625b3a976c348"
id = "05d34a880ebb34265ebbcac0a83625b3a976c348";
hash = "sha256-3VTBom8Lz6F/NXvjLzdhBddXS5FerV5eNHUkDPBDeD8=";
}
# ajout des NDD usuels ENS et DGNum pour autoriser les changements d'adresse mail # ajout des NDD usuels ENS et DGNum pour autoriser les changements d'adresse mail
{ "bc4742aaacb174a55a08baae5f354ada3fba4577"
id = "bc4742aaacb174a55a08baae5f354ada3fba4577";
hash = "sha256-LShcRzj/lnFQyJtc9+RxNQq8tsCcdYrwhe2BjqLr1pQ=";
}
# correction des svg des logos DGNum et DN # correction des svg des logos DGNum et DN
{ "ee474712a3e50d186acd8bbb52f60c1e4fee2f81"
id = "ee474712a3e50d186acd8bbb52f60c1e4fee2f81"; # remplacement Marianne - pour l'instant à l'arrache uniquement, logo sera repris et affiné plus tard
hash = "sha256-yoPCZOPPOk84n2oAISzjzJ8n3eWtsYqPglayRKcJGII="; "1965a47fda2bc50fe4ddb2fbac63deb36b933c6f"
}
# modifs Mariannes # modifs Mariannes
{ "222ae5abee8a255cb1fe4e19f6a7769b2df1cafb"
id = "222ae5abee8a255cb1fe4e19f6a7769b2df1cafb";
hash = "sha256-26+RKT87c1sbpt/No6f6qLGzTU/UC/3+SQVVUd8dtfk=";
}
# commenter quelques bouts de code inutiles dans l'usage DGNum de DS # commenter quelques bouts de code inutiles dans l'usage DGNum de DS
{ "ab8b515e3dbd340741a4562ab4f87c520ac99434"
id = "ab8b515e3dbd340741a4562ab4f87c520ac99434";
hash = "sha256-0yWAgLq5O1A6Rf4j/W/iKerX5f7ZlKE/tbCZ69Us2jo=";
}
# Update logo-ds.svg and delete commented lines # Update logo-ds.svg and delete commented lines
{ "ff36c4ad62f87086781743e843ec2ccde5eab8b6"
id = "ff36c4ad62f87086781743e843ec2ccde5eab8b6"; # correction logo DN pour pages d'erreur
hash = "sha256-XRTZXD0j7Uk9fVKRMnYdGhNZ5yk85LNeg6IVotgw840="; "bbe8e7d421466eea2b2ea56abf004bf91e29224c"
}
# correction logo DN pour les pages d'erreur
{
id = "bbe8e7d421466eea2b2ea56abf004bf91e29224c";
hash = "sha256-lo0giMktGn9vNBtn31EGSevEK/FXz6+crJNhVGexJec=";
}
# normalianisation de DN, texte # normalianisation de DN, texte
{ "0a630f87e214027e6b49073840fd4e1c1074ed2a"
id = "0a630f87e214027e6b49073840fd4e1c1074ed2a";
hash = "sha256-zu/FtAa/B2eJnpxzZJs1CeA5/Btm25LOjfeHnLLHtmI=";
}
# modifs sur le fichier en anglais # modifs sur le fichier en anglais
{ "e9e644a4d86b44cfad339d9e6af4ae4938e13f75"
id = "e9e644a4d86b44cfad339d9e6af4ae4938e13f75";
hash = "sha256-LoHzac2lC5YozlXOB4pqIkWPbJk2tq3326Sa+HsHGB8=";
}
# Use our logo in the header # Use our logo in the header
{ "e755b13183da2ea94d8d91de45eae71a1a9fb5b9"
id = "e755b13183da2ea94d8d91de45eae71a1a9fb5b9";
hash = "sha256-tt9vlsI6St1XeLe1c6xa2LTlKHHWMGP+pv1Kv2Q9hFU=";
}
] ]