This is an automated email from the ASF dual-hosted git repository. msciabarra pushed a commit to branch local-config in repository https://gitbox.apache.org/repos/asf/openserverless-task.git
commit 198f8a1db023e31f6ab98313bd4791d5ae7fe77a Author: Michele Sciabarra <[email protected]> AuthorDate: Sat Nov 8 10:13:28 2025 +0000 local config --- ide/docopts.md | 13 ++++++++----- ide/opsfile.yml | 13 +++++++++---- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ide/docopts.md b/ide/docopts.md index bb3be44..43a0cc0 100644 --- a/ide/docopts.md +++ b/ide/docopts.md @@ -60,12 +60,12 @@ Usage: ## Options ``` +--dry-run Simulates the execution without making any actual changes +--packages Only deploy packages, skip web upload +--web Only deploy web folder, skip packages --pin Save the current key in .env as AUTH_CHECK to verify deployments use that key --local Save the login as a local .wskprops instead of a global one --fast Skip the initial deployment step and go in incremental update mode ---dry-run Simulates the execution without making any actual changes ---packages Only deploy packages, skip web ---wen Only deploy web, skip packages ``` ## Login @@ -80,7 +80,10 @@ If you login with `ops ide login <username>` it will use, if not empty in prefer By default the credentials are stored in ~/.wskprops. If there is a local `.wskprops` in current directory it will used that instead. -If you specify `--local` credentials are stored in the local file. +If you specify `--local` or the variable `OPS_LOCAL` or ops `OPS_<username>_LOCAL` is not empty, +credentials are stored in the local file. Also if you login and there is already a local file will be used the local instead of the global. -If you specify `--pin` an `AUTH_CHECK` variable will be added to your `.env` to verify deployments use the intended configurations and not a different one by mistake. +If you specify `--pin`, or the variable `OPS_PIN` or `OPS_<username>_PIN`, +an `AUTH_CHECK` variable will be added to your `.env` to verify deployments +use the same configurations of the login and not another by mistake. \ No newline at end of file diff --git a/ide/opsfile.yml b/ide/opsfile.yml index a5eed1e..dfbbe3a 100644 --- a/ide/opsfile.yml +++ b/ide/opsfile.yml @@ -157,6 +157,11 @@ tasks: then source "$OPS_PWD/.env" fi + IS_LOCAL=$(if {{.__local}}; then echo "1" ; else echo "" ; fi) + IS_PIN=$(if {{.__pin}} ; then echo "1" ; else echo "" ; fi) + IS_LOCAL="$IS_LOCAL$OPS_LOCAL" + IS_PIN="$IS_PIN$OPS_PIN" + # load user variables if any if [ -n "{{._username_}}" ] then @@ -172,6 +177,8 @@ tasks: then OPS_PASSWORD="$OPS_{{._username_}}_PASSWORD" echo Using password from $OPS_{{._username_}}_PASSWORD for login fi + IS_LOCAL="$IS_LOCAL$OPS_{{._username_}}_LOCAL" + IS_PIN="$IS_PIN$OPS_{{._username_}}_PIN" fi if test -n "{{._apihost_}}" @@ -208,7 +215,7 @@ tasks: then export "OPS_PASSWORD" fi - if {{.__local}} + if test -n "$IS_LOCAL" then export WSK_CONFIG_FILE="$OPS_PWD/.wskprops" fi @@ -225,7 +232,7 @@ tasks: config OPSDEV_USERNAME="$OPSDEV_USERNAME" config OPSDEV_HOST="$OPSDEV_HOST_PROT://$OPSDEV_USERNAME.$OPSDEV_HOST_URL" source "$WSK_CONFIG_FILE" - if {{.__pin}} + if test -n "$IS_PIN" then echo "Pinning credentials to avoid deployment mistakes" if rg .env "^AUTH_CHECK=" @@ -238,8 +245,6 @@ tasks: false fi - - poll: silent: true desc: poll activation logs
