diff --git a/Features-Changelog.md b/Features-Changelog.md index 1e1dba6..a814744 100644 --- a/Features-Changelog.md +++ b/Features-Changelog.md @@ -4,6 +4,8 @@ This is the list of features added by release. Bug fixing are excluded. | release | bin | completions | man | config.yaml | | ------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | +| `1.22.0`| | | shed-kubectl-delete | +| `1.21.0`| | | shed-kubectl-apply | | `1.20.0`| | | shed-contexts | | `1.19.0`| | | shed-kubectl-logs-previous | | `1.18.0`| shed-kubectl-logs-previous, k-logs-p | | diff --git a/docs/documentation.md b/docs/documentation.md index f0886ab..020f9b4 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -28,7 +28,7 @@ | `shed` | | bin | ✅ | [📚 Doc](shed.md) | | `shed-kubectl-resources` | | bin | ✅ | [📚 Doc](shed-kubectl-resources.md) | | `shed-kubectl-apply` | `ka` | bin | ✅ | ❌ | -| `shed-kubectl-delete` | `kd` | bin | ❌ | ❌ | +| `shed-kubectl-delete` | `kd` | bin | ✅ | ❌ | | `shed-version` | | bin | ❌ | ❌ | | `shed-kubectl-secret-decode` | `k-secret-decode` | bin | ❌ | ❌ | diff --git a/release.env b/release.env index 2db028e..32a0c0a 100755 --- a/release.env +++ b/release.env @@ -1,5 +1,5 @@ -RELEASE_VERSION=1.21.1 -RELEASE_TITLE='fix man page bug - shed-contexts, shed' +RELEASE_VERSION=1.22.0 +RELEASE_TITLE='add man page - shed-kubectl-delete' REGISTRY_USERNAME_DOCKER=siakhooi diff --git a/src/DEBIAN/control b/src/DEBIAN/control index fb3223b..b757880 100644 --- a/src/DEBIAN/control +++ b/src/DEBIAN/control @@ -1,5 +1,5 @@ Package: siakhooi-shed -Version: 1.21.1 +Version: 1.22.0 Maintainer: Siak Hooi Depends: bash, coreutils, findutils, grep, vim, man-db, sed, siakhooi-devutils-echo-colors (>= 1.0.0), git, siakhooi-textutils (>= 1.7.0), bash-completion, jq Architecture: amd64 diff --git a/src/lib/shed-init b/src/lib/shed-init index 9af5a6f..4696b67 100755 --- a/src/lib/shed-init +++ b/src/lib/shed-init @@ -1,6 +1,6 @@ #!/bin/bash -export SHED_VERSION=1.21.1 +export SHED_VERSION=1.22.0 export SHED_CONFIG_HOME="${SHED_CONFIG_HOME:-$HOME/.shed}" export SHED_CONFIG_FILE=${SHED_CONFIG_HOME}/config.yaml export SHED_CONFIG_DIRECTORY_RESOURCES=$SHED_CONFIG_HOME/kubectl-resources diff --git a/src/md/shed-aliases.1.md b/src/md/shed-aliases.1.md index afed3bc..f1d994e 100644 --- a/src/md/shed-aliases.1.md +++ b/src/md/shed-aliases.1.md @@ -21,6 +21,8 @@ List aliases used by shed programs. \ \ \ \ alias h='shed-helm'\ \ \ \ \ alias i='shed-istioctl'\ \ \ \ \ alias k='shed-kubectl'\ +\ \ \ \ alias ka='shed-kubectl-apply'\ +\ \ \ \ alias kd='shed-kubectl-delete'\ \ \ \ \ alias k-bash='shed-kubectl-exec-bash'\ \ \ \ \ alias k-logs-f='shed-kubectl-logs-follow'\ \ \ \ \ alias k-logs-p='shed-kubectl-logs-previous'\ diff --git a/src/md/shed-kubectl-apply.1.md b/src/md/shed-kubectl-apply.1.md index 86f538a..fe91629 100644 --- a/src/md/shed-kubectl-apply.1.md +++ b/src/md/shed-kubectl-apply.1.md @@ -35,4 +35,4 @@ MIT Report bugs at https://github.com/siakhooi/shed/issues. # SEE ALSO -shed-kubectl-resources(1) +shed-kubectl-resources(1),shed-kubectl-delete(1) diff --git a/src/md/shed-kubectl-delete.1.md b/src/md/shed-kubectl-delete.1.md new file mode 100644 index 0000000..2c2b27a --- /dev/null +++ b/src/md/shed-kubectl-delete.1.md @@ -0,0 +1,39 @@ +% SHED-KUBECTL-DELETE(1) Siak Hooi DevUtils 1.1.0 | Shed Commands +% Siak Hooi +% April 2024 + +# NAME +shed-kubectl-delete - delete the resources based on resource located in directory set in \ +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ environment variable SHED_CONFIG_DIRECTORY_RESOURCES.\ +kd - alias to shed-kubectl-delete + +# SYNOPSIS +**shed-kubectl-delete** kubectl-resource\ +**shed kubectl-delete** kubectl-resource\ +**kd** kubectl-resource + +# DESCRIPTION +Delete the resources based on resource located in directory set in environment variable\ +SHED_CONFIG_DIRECTORY_RESOURCES. + +# EXAMPLES +**shed-kubectl-delete** hello-world\ +\ \ \ \ + kubectl --context kube-dev-1 delete -f /home/user1/.shed/kubectl-resources/hello-world\ +\ \ \ \ pod/hello-world deleted + +# FILES +~/.shed/kubectl-resources +: directory contains the resources + +# ENVIRONMENT VARIABLES +SHED_CONFIG_DIRECTORY_RESOURCES +: kubectl resources for **shed-kubectl-delete** and **shed-kubectl-delete**. + +# LICENSE +MIT + +# BUGS +Report bugs at https://github.com/siakhooi/shed/issues. + +# SEE ALSO +shed-kubectl-resources(1),shed-kubectl-apply(1) diff --git a/src/md/shed-kubectl-resources.1.md b/src/md/shed-kubectl-resources.1.md index a666c8a..9a1a4b2 100644 --- a/src/md/shed-kubectl-resources.1.md +++ b/src/md/shed-kubectl-resources.1.md @@ -23,4 +23,4 @@ MIT Report bugs at https://github.com/siakhooi/shed/issues. # SEE ALSO -shed-kubectl(1), shed-kubectl-apply(1) +shed-kubectl(1), shed-kubectl-apply(1), shed-kubectl-delete(1) diff --git a/src/md/shed-kubectl.1.md b/src/md/shed-kubectl.1.md index 32dfe73..a0e5c4f 100644 --- a/src/md/shed-kubectl.1.md +++ b/src/md/shed-kubectl.1.md @@ -32,4 +32,6 @@ MIT Report bugs at https://github.com/siakhooi/shed/issues. # SEE ALSO -shed-use(1), shed-kubeconfig-use(1), shed-helm(1), shed-istioctl(1), shed-kubectl-exec-sh(1), shed-kubectl-exec-bash(1), shed-kubectl-scale(1), shed-kubectl-resources(1) +shed-use(1), shed-kubeconfig-use(1), shed-helm(1), shed-istioctl(1)\ +shed-kubectl-exec-sh(1), shed-kubectl-exec-bash(1)\ +shed-kubectl-scale(1), shed-kubectl-resources(1), shed-kubectl-apply(1), shed-kubectl-delete(1) diff --git a/src/md/shed.1.md b/src/md/shed.1.md index c7b00b8..1da1004 100644 --- a/src/md/shed.1.md +++ b/src/md/shed.1.md @@ -14,6 +14,7 @@ shed is a collection of several bash scripts to manage Kubernetes clusters. **shed config-get** yamlPath\ **shed contexts**\ **shed kubectl-apply** kubectl-resource\ +**shed kubectl-delete** kubectl-resource\ **shed help**\ **shed value** yamlPath\ **shed value-key-list**\ @@ -36,6 +37,7 @@ shed is a collection of several bash scripts to manage Kubernetes clusters. **shed-config-get** yamlPath\ **shed-contexts**\ **shed-kubectl-apply** kubectl-resource\ +**shed-kubectl-delete** kubectl-resource\ **shed-value** yamlPath\ **shed-value-key-list**\ **shed-values**\ @@ -61,6 +63,7 @@ shed is a collection of several bash scripts to manage Kubernetes clusters. **h** [helm arguments]\ **i** [istioctl arguments]\ **ka** kubectl-resource\ +**ka** kubectl-delete\ **k-sh** (pod \| type/name) [container]\ **k-bash** (pod \| type/name) [container]\ **k-scale** replicas resourceName\ @@ -131,4 +134,4 @@ shed-value(1), shed-values(1), shed-value-key-list(1)\ shed-use(1), shed-kubeconfig-use(1), shed-kubectl(1), shed-helm(1), shed-isioctl(1)\ shed-kubectl-exec-sh(1),shed-kubectl-exec-bash(1),shed-kubectl-scale(1)\ shed-kubectl-logs-follow(1),shed-kubectl-logs-previous(1)\ -shed-kubectl-apply(1) \ No newline at end of file +shed-kubectl-resources(1),shed-kubectl-apply(1),shed-kubectl-delete(1) \ No newline at end of file diff --git a/tests/bats-test-scripts/man/man-1-shed-aliases.expected b/tests/bats-test-scripts/man/man-1-shed-aliases.expected index ebb661e..bee81ac 100644 --- a/tests/bats-test-scripts/man/man-1-shed-aliases.expected +++ b/tests/bats-test-scripts/man/man-1-shed-aliases.expected @@ -19,6 +19,8 @@ EXAMPLES alias h=`shed-helm' alias i=`shed-istioctl' alias k=`shed-kubectl' + alias ka=`shed-kubectl-apply' + alias kd=`shed-kubectl-delete' alias k-bash=`shed-kubectl-exec-bash' alias k-logs-f=`shed-kubectl-logs-follow' alias k-logs-p=`shed-kubectl-logs-previous' diff --git a/tests/bats-test-scripts/man/man-1-shed-kubectl-apply.expected b/tests/bats-test-scripts/man/man-1-shed-kubectl-apply.expected index 56af13d..16ad6ec 100644 --- a/tests/bats-test-scripts/man/man-1-shed-kubectl-apply.expected +++ b/tests/bats-test-scripts/man/man-1-shed-kubectl-apply.expected @@ -33,7 +33,7 @@ BUGS Report bugs at https://github.com/siakhooi/shed/issues. SEE ALSO - shed-kubectl-resources(1) + shed-kubectl-resources(1),shed-kubectl-delete(1) AUTHORS Siak Hooi. diff --git a/tests/bats-test-scripts/man/man-1-shed-kubectl-delete.expected b/tests/bats-test-scripts/man/man-1-shed-kubectl-delete.expected new file mode 100644 index 0000000..a28efb1 --- /dev/null +++ b/tests/bats-test-scripts/man/man-1-shed-kubectl-delete.expected @@ -0,0 +1,42 @@ +SHED-KUBECTL-DELETE(1) Shed Commands SHED-KUBECTL-DELETE(1) + +NAME + shed-kubectl-delete - delete the resources based on resource located in directory set in + environment variable SHED_CONFIG_DIRECTORY_RESOURCES. + kd - alias to shed-kubectl-delete + +SYNOPSIS + shed-kubectl-delete kubectl-resource + shed kubectl-delete kubectl-resource + kd kubectl-resource + +DESCRIPTION + Delete the resources based on resource located in directory set in environment variable + SHED_CONFIG_DIRECTORY_RESOURCES. + +EXAMPLES + shed-kubectl-delete hello-world + + kubectl -context kube-dev-1 delete -f /home/user1/.shed/kubectl-resources/hello-world + pod/hello-world deleted + +FILES + ~/.shed/kubectl-resources + directory contains the resources + +ENVIRONMENT VARIABLES + SHED_CONFIG_DIRECTORY_RESOURCES + kubectl resources for shed-kubectl-delete and shed-kubectl-delete. + +LICENSE + MIT + +BUGS + Report bugs at https://github.com/siakhooi/shed/issues. + +SEE ALSO + shed-kubectl-resources(1),shed-kubectl-apply(1) + +AUTHORS + Siak Hooi. + +Siak Hooi DevUtils 1.1.0 April 2024 SHED-KUBECTL-DELETE(1) diff --git a/tests/bats-test-scripts/man/man-1-shed-kubectl-resources.expected b/tests/bats-test-scripts/man/man-1-shed-kubectl-resources.expected index e444051..23a0df5 100644 --- a/tests/bats-test-scripts/man/man-1-shed-kubectl-resources.expected +++ b/tests/bats-test-scripts/man/man-1-shed-kubectl-resources.expected @@ -21,7 +21,7 @@ BUGS Report bugs at https://github.com/siakhooi/shed/issues. SEE ALSO - shed-kubectl(1), shed-kubectl-apply(1) + shed-kubectl(1), shed-kubectl-apply(1), shed-kubectl-delete(1) AUTHORS Siak Hooi. diff --git a/tests/bats-test-scripts/man/man-1-shed-kubectl.expected b/tests/bats-test-scripts/man/man-1-shed-kubectl.expected index 7fadea9..8746e7c 100644 --- a/tests/bats-test-scripts/man/man-1-shed-kubectl.expected +++ b/tests/bats-test-scripts/man/man-1-shed-kubectl.expected @@ -30,8 +30,9 @@ BUGS Report bugs at https://github.com/siakhooi/shed/issues. SEE ALSO - shed-use(1), shed-kubeconfig-use(1), shed-helm(1), shed-istioctl(1), shed-kubectl-exec-sh(1), shed-kubectl-ex- - ec-bash(1), shed-kubectl-scale(1), shed-kubectl-resources(1) + shed-use(1), shed-kubeconfig-use(1), shed-helm(1), shed-istioctl(1) + shed-kubectl-exec-sh(1), shed-kubectl-exec-bash(1) + shed-kubectl-scale(1), shed-kubectl-resources(1), shed-kubectl-apply(1), shed-kubectl-delete(1) AUTHORS Siak Hooi. diff --git a/tests/bats-test-scripts/man/man-1-shed.expected b/tests/bats-test-scripts/man/man-1-shed.expected index 371d944..9690800 100644 --- a/tests/bats-test-scripts/man/man-1-shed.expected +++ b/tests/bats-test-scripts/man/man-1-shed.expected @@ -12,6 +12,7 @@ SYNOPSIS shed config-get yamlPath shed contexts shed kubectl-apply kubectl-resource + shed kubectl-delete kubectl-resource shed help shed value yamlPath shed value-key-list @@ -34,6 +35,7 @@ SYNOPSIS shed-config-get yamlPath shed-contexts shed-kubectl-apply kubectl-resource + shed-kubectl-delete kubectl-resource shed-value yamlPath shed-value-key-list shed-values @@ -59,6 +61,7 @@ SYNOPSIS h [helm arguments] i [istioctl arguments] ka kubectl-resource + ka kubectl-delete k-sh (pod | type/name) [container] k-bash (pod | type/name) [container] k-scale replicas resourceName @@ -125,7 +128,7 @@ SEE ALSO shed-use(1), shed-kubeconfig-use(1), shed-kubectl(1), shed-helm(1), shed-isioctl(1) shed-kubectl-exec-sh(1),shed-kubectl-exec-bash(1),shed-kubectl-scale(1) shed-kubectl-logs-follow(1),shed-kubectl-logs-previous(1) - shed-kubectl-apply(1) + shed-kubectl-resources(1),shed-kubectl-apply(1),shed-kubectl-delete(1) AUTHORS Siak Hooi. diff --git a/tests/bats-test-scripts/man/man.bats b/tests/bats-test-scripts/man/man.bats index 62becbb..32312e6 100644 --- a/tests/bats-test-scripts/man/man.bats +++ b/tests/bats-test-scripts/man/man.bats @@ -63,6 +63,9 @@ run-man-test(){ @test "man shed-kubectl-apply" { run-man-test 1 shed-kubectl-apply } +@test "man shed-kubectl-delete" { + run-man-test 1 shed-kubectl-delete +} @test "man shed-kubectl" { run-man-test 1 shed-kubectl }