Commit d88ebe546793

Vincent Demeester <vincent@sbr.pm>
2020-07-16 16:57:42
pkgs/openshift-install: add multiple versions…
… and bump to the last one. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent d30165e
Changed files (2)
pkgs
pkgs/openshift-install/default.nix
@@ -1,36 +1,56 @@
 { stdenv, lib, fetchurl }:
 
-stdenv.mkDerivation rec {
-  pname = "openshift-install";
-  version = "4.4.11";
-  name = "${pname}-${version}";
+with lib;
+rec {
+  openshiftInstallGen =
+    { version
+    , sha256
+    }:
 
-  src = fetchurl {
-    url = "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${version}/openshift-install-linux-${version}.tar.gz";
-    sha256 = "0sahh666xalz60ycf6cv771xkhmfz4kvj6gbj217mzbpgb4pzlbd";
+    stdenv.mkDerivation rec {
+      pname = "openshift-install";
+      name = "${pname}-${version}";
+
+      src = fetchurl {
+        inherit sha256;
+        url = "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${version}/openshift-install-linux-${version}.tar.gz";
+      };
+
+      phases = " unpackPhase installPhase fixupPhase ";
+
+      unpackPhase = ''
+        runHook preUnpack
+        mkdir ${name}
+        tar -C ${name} -xzf $src
+      '';
+
+      installPhase = ''
+        runHook preInstall
+        install -D ${name}/openshift-install $out/bin/openshift-install
+        # completions
+        mkdir -p $out/share/bash-completion/completions/
+        $out/bin/openshift-install completion bash > $out/share/bash-completion/completions/openshift-install
+        mkdir -p $out/share/zsh/site-functions
+        $out/bin/openshift-install completion zsh > $out/share/zsh/site-functions/_openshift-install
+      '';
+
+      meta = {
+        description = "Install an OpenShift cluster";
+        homepage = https://github.com/openshift/installer;
+        license = lib.licenses.asl20;
+      };
+    };
+
+  openshift-install_4_5 = makeOverridable openshiftInstallGen {
+    version = "4.5.2";
+    sha256 = "0apb94914y9g2driwbnbcgd3y60jwsnpmb0n8nlzrshbfmkvp7l7";
   };
-
-  phases = " unpackPhase installPhase fixupPhase ";
-
-  unpackPhase = ''
-    runHook preUnpack
-    mkdir ${name}
-    tar -C ${name} -xzf $src
-  '';
-
-  installPhase = ''
-    runHook preInstall
-    install -D ${name}/openshift-install $out/bin/openshift-install
-    # completions
-    mkdir -p $out/share/bash-completion/completions/
-    $out/bin/openshift-install completion bash > $out/share/bash-completion/completions/openshift-install
-    mkdir -p $out/share/zsh/site-functions
-    $out/bin/openshift-install completion zsh > $out/share/zsh/site-functions/_openshift-install
-  '';
-
-  meta = {
-    description = "Install an OpenShift cluster";
-    homepage = https://github.com/openshift/installer;
-    license = lib.licenses.asl20;
+  openshift-install_4_4 = makeOverridable openshiftInstallGen {
+    version = "4.4.13";
+    sha256 = "10n2i0wkzay277cixc3qifag8l0pqba31ljvczx5m8bi06hnnsni";
+  };
+  openshift-install_4_3 = makeOverridable openshiftInstallGen {
+    version = "4.3.29";
+    sha256 = "0rrzmc8pkks8k3ar834z6k5nl0mgpi8llyb14slcn7mwilwg9024";
   };
 }
pkgs/default.nix
@@ -75,7 +75,12 @@ rec {
     oc_4_5
     ;
   oc = oc_4_4;
-  openshift-install = pkgs.callPackage ./openshift-install { };
+  inherit (pkgs.callPackage ./openshift-install { })
+    openshift-install_4_3
+    openshift-install_4_4
+    openshift-install_4_5
+    ;
+  openshift-install = openshift-install_4_4;
 
   inherit (pkgs.callPackage ./crc { oc_4_4 = oc_4_4; oc_4_3 = oc_4_3; })
     crc_1_9