| version: 3 |
| |
| vars: |
| OS: "{{or .__OS OS}}" |
| ARCH: "{{or .__ARCH ARCH}}" |
| DRY: "" |
| APIHOST: |
| sh: | |
| if test -z "$APIHOST" |
| then |
| wsk property get --apihost | awk '/whisk API host/{print $4}' |
| else |
| echo $APIHOST |
| fi |
| AUTH: |
| sh: | |
| if test -z "$AUTH" |
| then |
| wsk property get --apihost | awk '/whisk API auth/{print $4}' |
| else |
| echo $AUTH |
| fi |
| USERNAME: |
| sh: | |
| wsk property get --namespace | awk '{ print $3 }' |
| tasks: |
| prereq: |
| silent: true |
| cmds: |
| - test -e ~/.wskprops || die "please run 'ops -login' first" |
| - |
| add: |
| silent: true |
| desc: add a secret to user metadata |
| cmds: |
| - task: prereq |
| - | |
| # no quote here - syntax array generated by docpts |
| args={{._args_}} |
| # expanded and assigned to positional parameter |
| set -- ${args[@]} |
| # removing the '--' at the beginning required to pass extra flags |
| test "$1" = "--" && shift |
| export AUTH={{.AUTH}} |
| # execute the command line as passed and expanded |
| bun secrets.js add {{.USERNAME}} {{.APIHOST}} $(printf "%q " "$@") |
| |
| remove: |
| silent: true |
| desc: remove a secret to user metadata |
| cmds: |
| - task: prereq |
| - | |
| # no quote here - syntax array generated by docpts |
| args={{._args_}} |
| # expanded and assigned to positional parameter |
| set -- ${args[@]} |
| # removing the '--' at the beginning required to pass extra flags |
| test "$1" = "--" && shift |
| export AUTH={{.AUTH}} |
| # execute the command line as passed and expanded |
| bun secrets.js remove {{.USERNAME}} {{.APIHOST}} "$@" |
| |
| list: |
| silent: true |
| desc: add a secret to user metadata |
| cmds: |
| - task: prereq |
| - | |
| export AUTH={{.AUTH}} |
| # execute the command line as passed and expanded |
| bun secrets.js list {{.USERNAME}} {{.APIHOST}} {{.__format}} |