diff --git a/ide/docopts.md b/ide/docopts.md index 5bc22b21..8b35feb3 100644 --- a/ide/docopts.md +++ b/ide/docopts.md @@ -24,12 +24,12 @@ OpenServerless Ide Development Utilities. ```text Usage: - ide login [] [] + ide login [] [] [--pin] ide devel [--fast] [--dry-run] ide deploy [|--packages|--web] [--dry-run] ide undeploy [] [--dry-run] ide clean - ide setup + ide setup ide serve ide poll ide shell @@ -60,8 +60,9 @@ Usage: ## Options ``` ---dry-run Simulates the execution without making any actual changes +--dry-run Simulates the execution without making any actual changes --packages Only deploy packages, skip web upload --web Only deploy web folder, skip packages --fast Skip the initial deployment step and go in incremental update mode +--pin Pin the current auth in the .env to check you are not deploying on the wrong user ``` diff --git a/ide/nodejs/build-node.sh b/ide/nodejs/build-node.sh index 92350469..a8f77d5c 100644 --- a/ide/nodejs/build-node.sh +++ b/ide/nodejs/build-node.sh @@ -19,8 +19,7 @@ DIR="${1:?directory}" ZIP="${2:?zip file}" cd "$DIR" -npm install -touch node_modules/.package-lock.json +bun install if test -f "$ZIP" then rm "$ZIP" fi diff --git a/ide/opsfile.yml b/ide/opsfile.yml index 917c3786..75d28e86 100644 --- a/ide/opsfile.yml +++ b/ide/opsfile.yml @@ -48,10 +48,6 @@ tasks: You can then use 'ops ide devel' and 'ops ide deploy'. You can also reopen the project with VSCode and use the command 'Reopen in Container'. cmds: - - test -e "/.dockerenv" || die "{{.MSG}}" - - test "$(python3 -V | awk -F. '{print $2}')" -ge 10 || die "python 3.10 or greater not available" - - test -x "$(which virtualenv)" || die "you need python virtualenv" - - test "$(node -v | awk -F. '{print substr($1,2) }')" -ge 18 || die "nodejs 18 or greater not available" - test "$(printf '%s\n' "$(bun -v)" "1.1.18" | sort -V | head -n 1)" = "1.1.18" || die "bun 1.1.18 or greater not available" - test -d "$OPS_PWD/packages" || die "no packages in current directory" - test -e ~/.wskprops || die "please run 'ops ide login' first" @@ -141,7 +137,7 @@ tasks: login: - silent: true + silent: false desc: login in you OpenServerless host cmds: - | @@ -197,6 +193,13 @@ tasks: config OPSDEV_HOST="$OPSDEV_HOST_PROT://$OPSDEV_USERNAME.$OPSDEV_HOST_URL" source ~/.wskprops fi + if {{.__pin}} + then + touch $OPS_PWD/.env + mv $OPS_PWD/.env $OPS_PWD/.env.$$ + cat $OPS_PWD/.env.$$ | rg -v "AUTH_CHECK=" >$OPS_PWD/.env || true + echo "AUTH_CHECK=$AUTH" >>$OPS_PWD/.env + fi diff --git a/ide/python/build-venv.sh b/ide/python/build-venv.sh index cf94ce53..2a806a12 100644 --- a/ide/python/build-venv.sh +++ b/ide/python/build-venv.sh @@ -20,13 +20,9 @@ DIR="${1:?directory}" ZIP="${2:?zip file}" cd "$DIR" if ! test -d virtualenv - then virtualenv virtualenv +then uv venv virtualenv --python=/usr/bin/python3 fi -source virtualenv/bin/activate -pip install --upgrade pip -pip install -r requirements.txt -virtualenv/bin/python -m pip uninstall -y -q setuptools wheel pip -touch virtualenv/bin/activate +uv pip install --python=virtualenv/bin/python -r requirements.txt if test -f "$ZIP" then rm "$ZIP" fi diff --git a/ide/python/installer.code-workspace b/ide/python/installer.code-workspace new file mode 100644 index 00000000..0a4554ea --- /dev/null +++ b/ide/python/installer.code-workspace @@ -0,0 +1,17 @@ +{ + "folders": [ + { + "path": "../../.." + }, + { + "path": "../../../../python-starter" + } + ], + "settings": { + "workbench.colorCustomizations": { + "activityBar.background": "#5A0F2E", + "titleBar.activeBackground": "#7E1541", + "titleBar.activeForeground": "#FEFBFD" + } + } +} \ No newline at end of file diff --git a/ide/util/opsfile.yml b/ide/util/opsfile.yml index 0d30e1ba..7ff0c9df 100644 --- a/ide/util/opsfile.yml +++ b/ide/util/opsfile.yml @@ -30,11 +30,11 @@ tasks: then $OPS ide python zip DIR="$($OPS -opspath "packages/{{.A}}")" elif test -e "packages/{{.A}}/package.json" then $OPS ide nodejs zip DIR="$($OPS -opspath "packages/{{.A}}")" - else echo "no zip environment" + else true #echo "no zip environment" fi action: - desc: build an action filling its zip file + desc: build an action filling its zip file silent: true requires: { vars: [A]} cmds: