mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 16:10:05 +01:00
init cli, add start of target docs
This commit is contained in:
parent
d41bceaa4c
commit
612fa7d53c
3 changed files with 81 additions and 14 deletions
60
pkgs/kubenix.nix
Normal file
60
pkgs/kubenix.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
lib,
|
||||
writeShellScriptBin,
|
||||
coreutils,
|
||||
nix,
|
||||
jq,
|
||||
}: let
|
||||
name = "kubenix";
|
||||
in
|
||||
lib.recursiveUpdate
|
||||
(writeShellScriptBin name ''
|
||||
set -Eeuo pipefail
|
||||
|
||||
NAME=${name}
|
||||
function help() {
|
||||
echo "
|
||||
kubenix - Kubernetes resource management with Nix
|
||||
|
||||
commands:
|
||||
apply - create resources in target cluster
|
||||
render - print resource manifests to stdout
|
||||
"
|
||||
}
|
||||
|
||||
function apply() {
|
||||
echo not impremented
|
||||
}
|
||||
|
||||
function render() {
|
||||
${nix}/bin/nix eval '.#kubernetes' # | ${jq}/bin/jq 'fromjson'
|
||||
}
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
apply|"")
|
||||
shift
|
||||
apply
|
||||
;;
|
||||
render)
|
||||
shift
|
||||
render
|
||||
;;
|
||||
-h|--help)
|
||||
help
|
||||
exit 0
|
||||
;;
|
||||
-v|--verbose)
|
||||
shift
|
||||
set -x
|
||||
;;
|
||||
*)
|
||||
help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
'')
|
||||
{meta.description = "";}
|
||||
Loading…
Add table
Add a link
Reference in a new issue