kubectl.scm 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. (define-module (fiio kubectl)
  2. #:use-module ((guix licenses) #:prefix license:)
  3. #:use-module (guix build-system trivial)
  4. #:use-module (guix download)
  5. #:use-module (guix packages)
  6. #:use-module (gnu packages base)
  7. #:use-module (gnu packages compression))
  8. (define-public kubectl
  9. (package
  10. (name "kubectl")
  11. (version "1.16.3")
  12. (source (origin
  13. (method url-fetch)
  14. (uri (string-append
  15. "https://storage.googleapis.com/kubernetes-release/release/"
  16. "v" version
  17. "/bin/linux/amd64/kubectl"))
  18. (sha256
  19. (base32
  20. "0b8grhjry0ndbxgiraxhbf0mwr37v5zpajq265gmfhap8131pvfd"))))
  21. (build-system trivial-build-system)
  22. (arguments
  23. `(#:builder (begin
  24. (use-modules (guix build utils))
  25. (let* ((source (assoc-ref %build-inputs "source"))
  26. (out (assoc-ref %outputs "out"))
  27. (bindir (string-append out "/bin"))
  28. (target (string-append bindir "/kubectl")))
  29. (mkdir-p bindir)
  30. (copy-file source target)
  31. (chmod target #o555)
  32. #t))
  33. #:modules ((guix build utils))))
  34. (supported-systems '("x86_64-linux"))
  35. (home-page "https://kubernetes.io")
  36. (synopsis "Command line interface for running commands against Kubernetes clusters")
  37. (description "Kubectl is a command line interface for running
  38. commands against Kubernetes clusters. kubectl looks for a file named
  39. config in the $HOME/. kube directory. You can specify other kubeconfig
  40. files by setting the KUBECONFIG environment variable or by setting the
  41. --kubeconfig flag.")
  42. (license license:asl2.0)))
  43. (define-public kube-helm
  44. (package
  45. (name "kube-helm")
  46. (version "3.0.0")
  47. (source (origin
  48. (method url-fetch)
  49. (uri (string-append
  50. "https://get.helm.sh/helm-v" version "-linux-amd64.tar.gz"))
  51. (sha256
  52. (base32
  53. "1p60v2ij06nxa60ks9l1qgb3vvz19f93mf9cgcfjn1k3lb6gvq8h"))))
  54. (build-system trivial-build-system)
  55. (arguments
  56. '(#:builder (begin
  57. (use-modules (guix build utils))
  58. (let* ((source (assoc-ref %build-inputs "source"))
  59. (tar (assoc-ref %build-inputs "tar"))
  60. (xz (assoc-ref %build-inputs "xz"))
  61. (gzip (assoc-ref %build-inputs "gzip"))
  62. (fname "linux-amd64/helm")
  63. (out (assoc-ref %outputs "out"))
  64. (bindir (string-append out "/bin"))
  65. (target (string-append bindir "/helm")))
  66. (mkdir-p bindir)
  67. (set-path-environment-variable "PATH" '("bin")
  68. (list tar xz gzip))
  69. (invoke "tar" "-C" bindir
  70. "--strip-components=1"
  71. "-xvf" source fname)
  72. (chmod target #o555)
  73. #t))
  74. #:modules ((guix build utils))))
  75. (native-inputs
  76. `(("tar" ,tar)
  77. ("gzip" ,gzip)
  78. ("xz" ,xz)))
  79. (supported-systems '("x86_64-linux"))
  80. (home-page "https://helm.sh")
  81. (synopsis "The Kubernetes package manager")
  82. (description "This package is a tool for managing Charts. Charts
  83. are packages of pre-configured Kubernetes resources.")
  84. (license license:asl2.0)))