-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
omc is an OpenShift Must-gather Client :) Signed-off-by: Vincent Demeester <[email protected]>
- Loading branch information
1 parent
024919b
commit 21463f5
Showing
4 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ stdenv, lib, buildGo119Module, fetchFromGitHub }: | ||
|
||
with lib; | ||
rec { | ||
omcGen = | ||
{ version | ||
, sha256 | ||
, rev ? "v${version}" | ||
}: | ||
buildGo119Module rec { | ||
pname = "omc"; | ||
name = "${pname}-${version}"; | ||
|
||
#subPackages = [ "." ]; | ||
ldflags = | ||
let | ||
t = "github.com/gmeghnag/omc/vars"; | ||
in | ||
[ | ||
"-s" | ||
"-w" | ||
"-X ${t}.OMCVersionTag=${version}" | ||
# -X github.com/gmeghnag/omc/vars.OMCVersionHash=${HASH}" | ||
]; | ||
|
||
src = fetchFromGitHub { | ||
inherit rev; | ||
owner = "gmeghnag"; | ||
repo = "omc"; | ||
sha256 = "${sha256}"; | ||
}; | ||
vendorSha256 = null; | ||
|
||
doCheck = false; | ||
preBuild = '' | ||
export HOME=$(pwd) | ||
''; | ||
preInstall = '' | ||
pwd | ||
ls -la . | ||
''; | ||
postInstall = '' | ||
# completions | ||
mkdir -p $out/share/bash-completion/completions/ | ||
$out/bin/omc completion bash > $out/share/bash-completion/completions/omc | ||
mkdir -p $out/share/zsh/site-functions/ | ||
$out/bin/omc completion zsh > $out/share/zsh/site-functions/omc | ||
''; | ||
|
||
meta = { | ||
description = "OpenShift Must-Gather Client"; | ||
homepage = "https://github.com/gmeghnag/omc"; | ||
license = lib.licenses.asl20; | ||
}; | ||
}; | ||
|
||
omc_3_2 = makeOverridable omcGen { | ||
version = "3.2.0"; | ||
sha256 = "sha256-GBfRjS8u+KKBLie2GmzeLbD08V/LKNF7cbC7fjMxUtw="; | ||
}; | ||
omc = omc_3_2; | ||
|
||
omc-git = | ||
let | ||
repoMeta = importJSON ../repos/omc-main.json; | ||
in | ||
makeOverridable omcGen { | ||
version = "${repoMeta.version}"; | ||
rev = "${repoMeta.rev}"; | ||
sha256 = "${repoMeta.sha256}"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"type": "github", "owner": "gmeghnag", "repo": "omc", "rev": "3b3daed3641108a556df4d39533c189603131a6a", "sha256": "1p2j64rpxfxhf5xx2a6bbzqz9c1dvrn1mdi75s0s5y1f5y6x25qq", "version": "20230726.0"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters