Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"update-schema:shared": "tsx scripts/update-schema.ts --shared",
"deploy": "scripts/deploy.sh deploy",
"deploy:force": "scripts/deploy.sh deploy --force",
"deploy:skip-tests": "scripts/deploy.sh deploy --skip-tests",
"deploy:rollback": "scripts/deploy.sh rollback",
"deploy:status": "scripts/deploy.sh status",
"deploy:healthcheck": "scripts/deploy.sh healthcheck",
Expand Down
12 changes: 7 additions & 5 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Usage:
# scripts/deploy.sh # build + deploy current HEAD
# scripts/deploy.sh --force # deploy even if working tree is dirty / not on main
# scripts/deploy.sh --skip-tests # skip lint + tests only (still enforces branch/dirty checks)
# scripts/deploy.sh --clear-logs # clear stdout/stderr logs after deploy (default: preserve)
# scripts/deploy.sh --install-shim=<m> # m = standard|user-local|custom|skip; non-interactive choice
# # for the global `threadbase-streamer` shim. Default: prompt.
Expand Down Expand Up @@ -825,10 +826,11 @@ activate_release() {
}

cmd_deploy() {
local force="" clear_logs_flag=0
local force="" clear_logs_flag=0 skip_tests=0
for arg in "$@"; do
case "$arg" in
--force) force="--force" ;;
--skip-tests) skip_tests=1 ;;
--clear-logs) clear_logs_flag=1 ;;
--install-shim=*) export TB_INSTALL_SHIM="${arg#--install-shim=}" ;;
--path-update=*) export TB_PATH_UPDATE="${arg#--path-update=}" ;;
Expand All @@ -851,8 +853,8 @@ cmd_deploy() {

cd "$REPO_ROOT"
ensure_native_modules_match_node
if [[ "$force" == "--force" ]]; then
warn "skipping lint + tests (--force)"
if [[ "$force" == "--force" || "$skip_tests" == 1 ]]; then
warn "skipping lint + tests"
else
log "running lint + tests"
npm run lint
Expand Down Expand Up @@ -965,7 +967,7 @@ case "${1:-deploy}" in
shift
cmd_deploy "$@"
;;
--force|--install-shim=*|--path-update=*)
--force|--skip-tests|--install-shim=*|--path-update=*)
cmd_deploy "$@"
;;
"")
Expand All @@ -980,7 +982,7 @@ case "${1:-deploy}" in
nightly-uninstall) uninstall_nightly_restart_job ;;
*)
err "unknown command: $1"
echo "usage: $0 [deploy [--force] | rollback | status | healthcheck | restart | free-port | nightly-install | nightly-uninstall]" >&2
echo "usage: $0 [deploy [--force|--skip-tests] | rollback | status | healthcheck | restart | free-port | nightly-install | nightly-uninstall]" >&2
exit 2
;;
esac