argocd: Build the web-ui to make it usable (fixes #207618)
This commit is contained in:
@@ -5,6 +5,10 @@
|
||||
installShellFiles,
|
||||
nix-update-script,
|
||||
stdenv,
|
||||
fetchYarnDeps,
|
||||
yarnConfigHook,
|
||||
yarnBuildHook,
|
||||
nodejs,
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
@@ -18,6 +22,28 @@ buildGoModule rec {
|
||||
hash = "sha256-zg6zd10hpGUOukrwMK0qJXBL8nVgPSZJ6+jh+/mbOL0=";
|
||||
};
|
||||
|
||||
ui = stdenv.mkDerivation {
|
||||
pname = "${pname}-ui";
|
||||
inherit version;
|
||||
src = src + "/ui";
|
||||
|
||||
offlineCache = fetchYarnDeps {
|
||||
yarnLock = "${src}/ui/yarn.lock";
|
||||
hash = "sha256-ekhSPWzIgFhwSw0bIlBqu8LTYk3vuJ9VM8eHc3mnHGM=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
yarnConfigHook
|
||||
yarnBuildHook
|
||||
nodejs
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out
|
||||
cp -r dist $out/dist
|
||||
'';
|
||||
};
|
||||
|
||||
proxyVendor = true; # darwin/linux hash mismatch
|
||||
vendorHash = "sha256-tYHA1WlziKWOvv3uF3tTSrvqDoHBVRhUnKZXOxT1rMk=";
|
||||
|
||||
@@ -41,6 +67,11 @@ buildGoModule rec {
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
preBuild = ''
|
||||
cp -r ${ui}/dist ./ui
|
||||
stat ./ui/dist/app/index.html # Sanity check
|
||||
'';
|
||||
|
||||
# set ldflag for kubectlVersion since it is needed for argo
|
||||
# Per https://github.com/search?q=repo%3Aargoproj%2Fargo-cd+%22KUBECTL_VERSION%3D%22+path%3AMakefile&type=code
|
||||
prePatch = ''
|
||||
|
||||
Reference in New Issue
Block a user