Unverified Commit cb083919 authored by Stanisław Pitucha's avatar Stanisław Pitucha Committed by GitHub
Browse files

kratos: add version check (#502026)

parents ebbc8a4c b30c782d
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
  buildGoModule,
  lib,
  stdenv,
  versionCheckHook,
}:

buildGoModule (finalAttrs: {
@@ -24,9 +25,12 @@ buildGoModule (finalAttrs: {

  # Pass versioning information via ldflags
  ldflags = [
    "-X github.com/ory/kratos/driver/config.Version=${finalAttrs.version}"
    "-X github.com/ory/kratos/driver/config.Version=v${finalAttrs.version}"
  ];

  # large portion of tests fail due to:
  #     provider.go:39: building the Go binary returned error: exit status 1
  #        cannot find module providing package github.com/ory/x/jsonnetsecure/cmd: import lookup disabled by -mod=vendor
  doCheck = false;

  preBuild = ''
@@ -43,6 +47,10 @@ buildGoModule (finalAttrs: {
    substituteInPlace Makefile --replace-fail '/usr/bin/env bash' '${stdenv.shell}'
  '';

  doInstallCheck = true;
  nativeInstallCheckInputs = [ versionCheckHook ];
  versionCheckProgramArg = [ "version" ];

  meta = {
    mainProgram = "kratos";
    description = "API-first Identity and User Management system that is built according to cloud architecture best practices";