Compare commits

...

7 Commits
v3.7.1 ... v3.7

Author SHA1 Message Date
a03885e8db v3.7.8
=====================================================================

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

- --list-envs now shows all available environments
2023-11-13 16:19:05 -07:00
6cc10e3f4f v3.7.7
=====================================================================

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

- GitHub Actions now autodetects groups within the "$GITHUB_WORKSPACE"
2023-11-13 13:16:04 -07:00
4a1208942d v3.7.6
=====================================================================

Documentation update
2023-11-13 12:30:49 -07:00
91780024f0 v3.7.5
=====================================================================

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

- adding variables of the format `^SCWRYPTS_GROUP_LOADERS__[a-z_]\+=`
  will let those files be explicitly sourced during run (this should
  allow custom group usage in CI)
2023-11-13 12:27:15 -07:00
3ca4fe0c65 v3.7.4
=====================================================================

--- Bug Fixes ----------------------------

- fixed typo in Vundle.vim clone
2023-11-11 15:27:34 -07:00
e6dfff255c v3.7.3
=====================================================================

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

- Helm template generation looks for default values in file://
  dependencies in addition to the standard values locations

- vundle installer now *actually installs Vundle.vim* if it is missing
2023-11-11 15:13:30 -07:00
15942bb08d v3.7.2
=====================================================================

--- Bug Fixes ----------------------------

- Various github-actions fixes
2023-11-10 17:41:01 -07:00
8 changed files with 69 additions and 8 deletions

View File

@ -48,6 +48,8 @@ There are a few notable changes to this runtime:
- User yes/no prompts will **always be YES** - User yes/no prompts will **always be YES**
- Other user input will default to an empty string - Other user input will default to an empty string
- Logs will not be captured - Logs will not be captured
- Setting the environment variable `SCWRYPTS_GROUP_LOADER__[a-z_]\+` will source the file indicated in the variable (this allows custom groups without needing to modify the `config.zsh` directly)
- In GitHub actions, `*.scwrypts.zsh` groups are detected automatically from the `$GITHUB_WORKSPACE`; set `SCWRYPTS_GITHUB_NO_AUTOLOAD=true` to disable
## Contributing ## Contributing

View File

@ -1,7 +1,7 @@
--- # allow running scwrypts in Github Actions --- # allow running scwrypts in Github Actions
name: scwrypts name: scwrypts
author: yage author: yage
description: check requird dependencies and run a scwrypt description: check required dependencies and run a scwrypt
inputs: inputs:
scwrypt: scwrypt:
@ -27,7 +27,7 @@ runs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
repository: wrynegade/scwrypts repository: wrynegade/scwrypts
path: ./scwrypts path: ./wrynegade/scwrypts
ref: ${{ inputs.version }} ref: ${{ inputs.version }}
- name: check dependencies - name: check dependencies
@ -43,7 +43,7 @@ runs:
sudo apt-get update sudo apt-get update
sudo apt-get install --yes zsh fzf ripgrep sudo apt-get install --yes zsh fzf ripgrep
for D in $($GITHUB_WORKSPACE/scwrypts/scwrypts -n --name check-all-dependencies --group ci --type zsh) for D in $($GITHUB_WORKSPACE/wrynegade/scwrypts/scwrypts -n --name check-all-dependencies --group ci --type zsh)
do do
echo "--- installing $D ---" echo "--- installing $D ---"
( sudo apt-get install --yes $D; exit 0; ) ( sudo apt-get install --yes $D; exit 0; )
@ -51,7 +51,7 @@ runs:
} > $HOME/.scwrypts.apt-get.log 2>&1 } > $HOME/.scwrypts.apt-get.log 2>&1
echo "updating virtual dependencies" echo "updating virtual dependencies"
$GITHUB_WORKSPACE/scwrypts/scwrypts -n \ $GITHUB_WORKSPACE/wrynegade/scwrypts/scwrypts -n \
--name scwrypts/virtualenv/update-all \ --name scwrypts/virtualenv/update-all \
--group scwrypts \ --group scwrypts \
--type zsh \ --type zsh \
@ -65,4 +65,4 @@ runs:
env: env:
CI: true CI: true
SCWRYPTS_ENV: ${{ inputs.scwrypts-env }} SCWRYPTS_ENV: ${{ inputs.scwrypts-env }}
run: $GITHUB_WORKSPACE/scwrypts/scwrypts ${{inputs.scwrypt}} -- ${{inputs.args}} run: $GITHUB_WORKSPACE/wrynegade/scwrypts/scwrypts ${{inputs.scwrypt}} -- ${{inputs.args}} || exit 1

8
run
View File

@ -17,7 +17,8 @@ __RUN() {
-e, --env <env-name> set environment; overwrites SCWRYPTS_ENV -e, --env <env-name> set environment; overwrites SCWRYPTS_ENV
-n, --no-log skip logging and run in quiet mode -n, --no-log skip logging and run in quiet mode
--update update scwrypts library to latest version --update update scwrypts library to latest version
--list-envs print out environment list and exit
-v, --version print out scwrypts version and exit -v, --version print out scwrypts version and exit
-l, --list print out command list and exit -l, --list print out command list and exit
@ -78,6 +79,10 @@ __RUN() {
SCWRYPTS__GET_AVAILABLE_SCWRYPTS SCWRYPTS__GET_AVAILABLE_SCWRYPTS
return 0 return 0
;; ;;
--list-envs )
SCWRYPTS__GET_ENV_NAMES
return 0
;;
-v | --version ) -v | --version )
echo scwrypts $(cd "$SCWRYPTS__ROOT__scwrypts"; git describe --tags) echo scwrypts $(cd "$SCWRYPTS__ROOT__scwrypts"; git describe --tags)
return 0 return 0
@ -218,6 +223,7 @@ __RUN() {
[[ $ENV_REQUIRED -eq 1 ]] && { [[ $ENV_REQUIRED -eq 1 ]] && {
[ ! $ENV_NAME ] && ENV_NAME=$(SCWRYPTS__SELECT_ENV) [ ! $ENV_NAME ] && ENV_NAME=$(SCWRYPTS__SELECT_ENV)
for GROUP in ${SCWRYPTS_GROUPS[@]} for GROUP in ${SCWRYPTS_GROUPS[@]}
do do
local ENV_FILE=$(SCWRYPTS__GET_ENV_FILE "$ENV_NAME" "$GROUP") local ENV_FILE=$(SCWRYPTS__GET_ENV_FILE "$ENV_NAME" "$GROUP")

View File

@ -47,6 +47,26 @@ do
} }
done done
#####################################################################
for GROUP_LOADER in $(env | sed -n 's/^SCWRYPTS_GROUP_LOADER__[a-z_]\+=//p')
do
[ -f "$GROUP_LOADER" ] && source "$GROUP_LOADER"
done
: \
&& [ ! "$SCWRYPTS_AUTODETECT_GROUP_BASEDIR" ] \
&& [ $GITHUB_WORKSPACE ] \
&& [ ! $SCWRYPTS_GITHUB_NO_AUTOLOAD ] \
&& SCWRYPTS_AUTODETECT_GROUP_BASEDIR="$GITHUB_WORKSPACE"
[ "$SCWRYPTS_AUTODETECT_GROUP_BASEDIR" ] && [ -d "$SCWRYPTS_AUTODETECT_GROUP_BASEDIR" ] && {
for GROUP_LOADER in $(find "$SCWRYPTS_AUTODETECT_GROUP_BASEDIR" -type f -name \*scwrypts.zsh)
do
[ -f "$GROUP_LOADER" ] && source "$GROUP_LOADER"
done
}
##################################################################### #####################################################################
[ $NO_EXPORT_CONFIG ] || __SCWRYPT=1 # arbitrary; indicates currently inside a scwrypt [ $NO_EXPORT_CONFIG ] || __SCWRYPT=1 # arbitrary; indicates currently inside a scwrypt
true true

View File

@ -17,6 +17,8 @@ HELM__TEMPLATE__GET() {
--colorize use 'bat' to colorize output --colorize use 'bat' to colorize output
--raw remove scwrypts-added fluff and only output helm template details --raw remove scwrypts-added fluff and only output helm template details
-h, --help show this help dialogue
Smart helm-template generator which auto-detects the chart Smart helm-template generator which auto-detects the chart
and sample values for testing and developing helm charts. and sample values for testing and developing helm charts.
" "
@ -35,8 +37,11 @@ HELM__TEMPLATE__GET() {
;; ;;
--raw ) RAW=1 ;; --raw ) RAW=1 ;;
-h | --help ) USAGE; return 0 ;;
-- ) shift 1; break ;; -- ) shift 1; break ;;
* ) HELM_ARGS+=($1) ;; * ) HELM_ARGS+=($1) ;;
esac esac
shift 1 shift 1

View File

@ -54,6 +54,28 @@ _HELM__GET_CHART_ROOT() {
} }
_HELM__GET_DEFAULT_VALUES_ARGS() { _HELM__GET_DEFAULT_VALUES_ARGS() {
for LOCAL_REPOSITORY in $(\
cat "$CHART_ROOT/Chart.yaml" \
| yq -r '.dependencies[] | .repository' \
| grep '^file://' \
| sed 's|file://||' \
)
do
[[ $LOCAL_REPOSITORY =~ ^[/~] ]] \
&& LOCAL_REPOSITORY_ROOT="$LOCAL_REPOSITORY" \
|| LOCAL_REPOSITORY_ROOT="$CHART_ROOT/$LOCAL_REPOSITORY" \
;
for F in \
"$LOCAL_REPOSITORY_ROOT/values.yaml" \
"$LOCAL_REPOSITORY_ROOT/values.test.yaml" \
"$LOCAL_REPOSITORY_ROOT/tests/default.yaml" \
;
do
[ -f "$F" ] && HELM_ARGS+=(--values "$F")
done
done
for F in \ for F in \
"$CHART_ROOT/values.yaml" \ "$CHART_ROOT/values.yaml" \
"$CHART_ROOT/values.test.yaml" \ "$CHART_ROOT/values.test.yaml" \
@ -63,3 +85,4 @@ _HELM__GET_DEFAULT_VALUES_ARGS() {
[ -f "$F" ] && HELM_ARGS+=(--values "$F") [ -f "$F" ] && HELM_ARGS+=(--values "$F")
done done
} }

View File

@ -20,7 +20,7 @@ VUNDLE__PLUGIN_LIST=$(ls $VUNDLE__PLUGIN_DIR | grep -v 'Vundle.vim' | grep -v 'b
source $VUNDLE__BUILD_DEFINITIONS source $VUNDLE__BUILD_DEFINITIONS
for PLUGIN in $(echo $VUNDLE__PLUGIN_LIST) for PLUGIN in $(echo $VUNDLE__PLUGIN_LIST)
do do
typeset -f VUNDLE__BUILD__$PLUGIN >/dev/null 2>/dev/null || { which VUNDLE__BUILD__$PLUGIN >/dev/null 2>/dev/null || {
echo -e "\nVUNDLE__BUILD__$PLUGIN() {\n # ... build steps from $HOME/.vim/$PLUGIN \n}" \ echo -e "\nVUNDLE__BUILD__$PLUGIN() {\n # ... build steps from $HOME/.vim/$PLUGIN \n}" \
>> $VUNDLE__BUILD_DEFINITIONS >> $VUNDLE__BUILD_DEFINITIONS
VUNDLE__BUILD__$PLUGIN() {} VUNDLE__BUILD__$PLUGIN() {}

View File

@ -8,7 +8,12 @@ CHECK_ENVIRONMENT
##################################################################### #####################################################################
PLUGIN_INSTALL() { PLUGIN_INSTALL() {
VUNDLE__PLUGIN_INSTALL || return 1 [ -d "$HOME/.vim/bundle/Vundle.vim" ] || {
mkdir -p "$HOME/.vim/bundle/"
git clone https://github.com/VundleVim/Vundle.vim.git "$HOME/.vim/bundle/Vundle.vim"
}
VUNDLE__PLUGIN_INSTALL || return 1
VUNDLE__REBUILD_PLUGINS || return 2 VUNDLE__REBUILD_PLUGINS || return 2
} }