Skip to content

Commit

Permalink
mattermostLatest: init at 10.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
numinit committed Jan 13, 2025
1 parent d80668b commit 4a1fadc
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 9 deletions.
31 changes: 22 additions & 9 deletions pkgs/by-name/ma/mattermost/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,31 @@
fetchNpmDeps,
jq,
nixosTests,

versionInfo ? {
# ESR releases only.
# See https://docs.mattermost.com/upgrade/extended-support-release.html
# When a new ESR version is available (e.g. 8.1.x -> 9.5.x), update
# the version regex here as well.
#
# Ensure you also check ../mattermostLatest/package.nix.
regex = "^v(9\.11\.[0-9]+)$";
version = "9.11.6";
srcHash = "sha256-G9RYktnnVXdhNWp8q+bNbdlHB9ZOGtnESnZVOA7lDvE=";
vendorHash = "sha256-Gwv6clnq7ihoFC8ox8iEM5xp/us9jWUrcmqA9/XbxBE=";
npmDepsHash = "sha256-ysz38ywGxJ5DXrrcDmcmezKbc5Y7aug9jOWUzHRAs/0=";
},
}:

buildGoModule rec {
pname = "mattermost";
# ESR releases only.
# See https://docs.mattermost.com/upgrade/extended-support-release.html
# When a new ESR version is available (e.g. 8.1.x -> 9.5.x), update
# the version regex in passthru.updateScript as well.
version = "9.11.6";
inherit (versionInfo) version;

src = fetchFromGitHub {
owner = "mattermost";
repo = "mattermost";
rev = "v${version}";
hash = "sha256-G9RYktnnVXdhNWp8q+bNbdlHB9ZOGtnESnZVOA7lDvE=";
hash = versionInfo.srcHash;
postFetch = ''
cd $out/webapp
Expand Down Expand Up @@ -54,7 +64,7 @@ buildGoModule rec {
npmDeps = fetchNpmDeps {
inherit src;
sourceRoot = "${src.name}/webapp";
hash = "sha256-ysz38ywGxJ5DXrrcDmcmezKbc5Y7aug9jOWUzHRAs/0=";
hash = versionInfo.npmDepsHash;
makeCacheWritable = true;
forceGitDeps = true;
};
Expand Down Expand Up @@ -99,7 +109,7 @@ buildGoModule rec {
'';
};

vendorHash = "sha256-Gwv6clnq7ihoFC8ox8iEM5xp/us9jWUrcmqA9/XbxBE=";
inherit (versionInfo) vendorHash;

modRoot = "./server";
preBuild = ''
Expand Down Expand Up @@ -144,7 +154,10 @@ buildGoModule rec {
updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"^v(9\.11\.[0-9]+)$"
versionInfo.regex
] ++ lib.optionals (versionInfo.autoUpdate or null != null) [
"--override-filename"
versionInfo.autoUpdate
];
};
tests.mattermost = nixosTests.mattermost;
Expand Down
20 changes: 20 additions & 0 deletions pkgs/by-name/ma/mattermostLatest/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
mattermost,
}:

mattermost.override {
versionInfo = {
# Latest, non-RC releases only.
# If the latest is an ESR (Extended Support Release),
# duplicate it here to facilitate the update script.
# See https://docs.mattermost.com/about/mattermost-server-releases.html
# and make sure the version regex is up to date here.
# Ensure you also check ../mattermost/package.nix for ESR releases.
regex = "^v(10\.3\.[0-9]+)$";
version = "10.3.1";
srcHash = "sha256-nghwf9FgdqEDLkm8dKqhvY1SvALSZ8dasTDwMwbL5AI=";
vendorHash = "sha256-G2IhU8/XSITjJKNu1Iwwoabm+hG9r3kLPtZnlzuKBD8=";
npmDepsHash = "sha256-Dc+ZFQzRQoUnsZDnPs55gr6O82WwyuBEmCZYFAwW50M=";
autoUpdate = ./package.nix;
};
}

0 comments on commit 4a1fadc

Please sign in to comment.