feat(compute01/ds-fr): Make update autonomous and update to latest version

This commit is contained in:
Tom Hubrecht 2023-11-16 09:21:34 +01:00
parent 53bfa5a456
commit 9555a5c8e5
5 changed files with 31 additions and 14 deletions

View file

@ -1,16 +1,18 @@
{ lib, stdenv, fetchFromGitHub, fetchYarnDeps, yarn, fixup_yarn_lock, nodejs, ruby_3_2
, bundlerEnv, logDir ? "/var/log/ds-fr", dataDir ? "/var/lib/ds-fr"
{ lib, stdenv, fetchFromGitHub, fetchYarnDeps, yarn, fixup_yarn_lock, nodejs
, ruby_3_2, bundlerEnv, logDir ? "/var/log/ds-fr", dataDir ? "/var/lib/ds-fr"
, initialDeploymentDate ? "17941030" }:
let
pname = "ds-fr";
version = "2023-11-10-01";
meta = import ./meta.nix;
inherit (meta) version;
src = fetchFromGitHub {
owner = "demarches-simplifiees";
repo = "demarches-simplifiees.fr";
rev = version;
hash = "sha256-NRCHISV2EE5sePvVTZfxCJVt7+SgEyMQu/fNDWoLhkk=";
hash = meta.src-hash;
};
rubyEnv = bundlerEnv {
@ -37,7 +39,7 @@ let
offlineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
hash = "sha256-/CI6LHI2I0BinrDduN0NNfBSGDynz0lQuySdFaWGaOo=";
hash = meta.deps-hash;
};
buildInputs = [ rubyEnv ];

View file

@ -0,0 +1,5 @@
{
version = "2023-11-16-01";
src-hash = "sha256-A+l8jEWSlCrCdC2/4XGQ9tzXolw7pJbABIPNcgLz52Y=";
deps-hash = "sha256-bEjrlOsnzcX3InQ3QwNCmGBPnX4m740F7cf94n52Tu8=";
}

View file

@ -161,7 +161,7 @@ GEM
nokogiri (~> 1.10, >= 1.10.4)
rubyzip (>= 1.3.0, < 3)
charlock_holmes (0.7.7)
chartkick (4.1.3)
chartkick (5.0.4)
choice (0.2.0)
chunky_png (1.4.0)
clamav-client (3.2.0)
@ -293,8 +293,8 @@ GEM
bundler (>= 1.14)
graphql (>= 1.10, < 3.0)
thor (>= 0.19, < 2.0)
groupdate (5.2.2)
activesupport (>= 5)
groupdate (6.4.0)
activesupport (>= 6.1)
haml (6.0.5)
temple (>= 0.8.2)
thor

View file

@ -505,10 +505,10 @@
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0qjnm98ki484xy8xqz7xwxvja3j01ybl7v30viz1wff48w5y51gh";
sha256 = "0838bglijxsv3yyl3xif7fvs1x7rn4sv2kld90b52ybyazvjsldh";
type = "gem";
};
version = "4.1.3";
version = "5.0.4";
};
choice = {
groups = ["default" "development"];
@ -1121,10 +1121,10 @@
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0zfa34vczk21c2sz6xq8n0y7c7dn9628kj6yicyazlx3rg5r18wg";
sha256 = "0m7cbahlhd7akkizrn2rjp4g6y6wkg8s3dqas6rgjj1apx2hd535";
type = "gem";
};
version = "5.2.2";
version = "6.4.0";
};
haml = {
dependencies = ["temple" "thor" "tilt"];

View file

@ -52,10 +52,20 @@ cp gemset.nix Gemfile Gemfile.lock "$CWD/rubyEnv/"
# Print the new source details
echo "[+] New hash:"
nix-shell -p nurl --run "nurl --hash $gitUrl $version"
SRC_HASH=$(nix-shell -p nurl --run "nurl --hash $gitUrl $version")
# Print Yarn deps hash
echo "[+] New dependencies hash:"
hash=$(nix-shell -p prefetch-yarn-deps --run "prefetch-yarn-deps yarn.lock")
nix-hash --to-sri --type sha256 "$hash"
DEPS_HASH=$(nix-hash --to-sri --type sha256 "$hash")
cat <<EOF > "$CWD/meta.nix"
{
version = "$version";
src-hash = "$SRC_HASH";
deps-hash = "$DEPS_HASH";
}
EOF
rm -rf "$TMP"