=====================================================================

--- New Features -------------------------

- Github Actions integration from 3.7.0 and up!

```yaml
  # try it out in gh actions
  - uses: wrynegade/scwrypts@main
    with:
      version: v3.7.0
      scwrypt: --name hello-world --group scwrypts --type py
      args: --message "hello from github actions ci <3"
```

--- New Scripts --------------------------

zsh/helm )
  smart helm template functions (simply pass a filename)
   - get-template
   - update-dependencies

--- Changes ------------------------------

- CHECK_ENVIRONMENT now uses proper argument parsing

- scwrypts/plugins loaded by setting in config or environment:
   SCWRYPTS_PLUGIN_ENABLED__plugin=1

- SCWRYPTS__GET_PATH_TO_RELATIVE_ARGUMENT was missed in the v2->v3
  refactor and has now been reincluded as SCWRYPTS__GET_REALPATH
This commit is contained in:
2023-10-30 14:23:23 -06:00
parent 570fc6a435
commit 6f42c9cb16
21 changed files with 527 additions and 59 deletions

View File

@ -0,0 +1 @@
#!/bin/zsh

10
plugins/ci/README.md Normal file
View File

@ -0,0 +1,10 @@
# Kubernetes `kubectl` Helper Plugin
Leverages a local `redis` application to quickly and easily set an alias `k` for `kubectl --context <some-context> --namespace <some-namespace>`.
Much like scwrypts environments, `k` aliases are *only* shared amongst session with the same `SCWRYPTS_ENV` to prevent accidental cross-contamination.
## Getting Started
Enable the plugin in `~/.config/scwrypts/config.zsh` by adding `SCWRYPTS_PLUGIN_ENABLED__KUBECTL=1`.
Use `k` as your new `kubectl` and checkout `k --help` and `k meta --help`.

View File

@ -0,0 +1,40 @@
#!/bin/zsh
#####################################################################
DEPENDENCIES+=()
REQUIRED_ENV+=()
#####################################################################
MAIN() {
cd "$SCWRYPTS_ROOT__scwrypts/"
DEPENDENCIES+=()
for group in ${SCWRYPTS_GROUPS[@]}
do
[[ $group =~ ^ci$ ]] && continue
GROUP_HOME="$(eval 'echo $SCWRYPTS_ROOT__'$group)"
[ $GROUP_HOME ] && [ -d "$GROUP_HOME" ] || continue
STATUS "checking dependencies for $group"
DEPENDENCIES+=($(
for file in $(
{
cd "$GROUP_HOME"
rg -l '^DEPENDENCIES\+=\($'
rg -l '^DEPENDENCIES\+=\([^)]\+\)'
} | grep -v '\.md$' | grep -v 'check-all-dependencies$')
do
sed -z 's/.*DEPENDENCIES+=(\([^)]*\)).*/\1\n/; s/#.*\n//g; s/\s\+/\n/g' "$GROUP_HOME/$file"
done
))
done
DEPENDENCIES=(zsh $(echo $DEPENDENCIES | sed 's/ /\n/g' | sort -u | grep '^[-_a-zA-Z]\+$'))
STATUS "discovered dependencies: ($DEPENDENCIES)"
echo $DEPENDENCIES | sed 's/ /\n/g'
CHECK_ENVIRONMENT && SUCCESS "all dependencies satisfied"
}
#####################################################################
MAIN $@

View File

@ -0,0 +1,5 @@
SCWRYPTS_GROUPS+=(ci)
export SCWRYPTS_TYPE__ci=zsh
export SCWRYPTS_ROOT__ci="$SCWRYPTS_ROOT__scwrypts/plugins/ci"
export SCWRYPTS_COLOR__ci='\033[0m'