Skip to content

Commit 1610d1b

Browse files
committed
gpsps - push, pr, deploy staging
1 parent ca608fd commit 1610d1b

File tree

3 files changed

+33
-16
lines changed

3 files changed

+33
-16
lines changed

bashrc/default.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ if [ -x /usr/bin/dircolors ]; then
3131
fi
3232

3333
# Default editors
34-
export EDITOR="cursor --wait"
35-
export VISUAL="cursor --wait"
36-
export GUI_EDITOR="cursor"
37-
export REACT_EDITOR="cursor"
38-
export BUNDLER_EDITOR="cursor"
34+
export EDITOR="cursor editor --wait"
35+
export VISUAL="cursor editor --wait"
36+
export GUI_EDITOR="cursor editor"
37+
export REACT_EDITOR="cursor editor"
38+
export BUNDLER_EDITOR="cursor editor"
3939
export GIT_EDITOR="vim"
40-
export KUBE_EDITOR="cursor --wait"
40+
export KUBE_EDITOR="cursor editor --wait"
4141

4242
# GPG
4343
export GPG_TTY=$(tty)

bashrc/github.sh

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
11
#!/bin/bash
22
# See: https://docs.gitlab.com/ee/user/project/push_options.html
33

4-
# Push and create GitHub PR, then wait for CI build to finish
5-
gpsp() (
6-
set -euo pipefail
7-
git push
4+
# Push, open a GitHub PR, and surface the latest pipeline status in Chrome.
5+
_git_push_create_pr_and_open_pipeline() {
6+
git push "$@"
87
gh pr create --fill || true
98
gh pr view --web
109

11-
local CURRENT_GIT_BRANCH CURRENT_GIT_COMMIT
12-
CURRENT_GIT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
13-
CURRENT_GIT_COMMIT="$(git rev-parse HEAD)"
14-
PIPELINE_URL="$(./scripts/circleci_pipeline_status -f "%u" -b "$CURRENT_GIT_BRANCH" -c "$CURRENT_GIT_COMMIT")"
15-
local CHROME_BIN="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
16-
"$CHROME_BIN" "${PIPELINE_URL}" 2>/dev/null
10+
local current_git_branch current_git_commit pipeline_url
11+
current_git_branch="$(git rev-parse --abbrev-ref HEAD)"
12+
current_git_commit="$(git rev-parse HEAD)"
13+
pipeline_url="$(./scripts/circleci_pipeline_status -f "%u" -b "$current_git_branch" -c "$current_git_commit")"
14+
local chrome_bin="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
15+
"$chrome_bin" "${pipeline_url}" 2>/dev/null
16+
}
1717

18+
# Push and create GitHub PR, then wait for CI build to finish
19+
gpsp() (
20+
set -euo pipefail
21+
_git_push_create_pr_and_open_pipeline "$@"
1822
[ -f scripts/wait_for_ci_build ] && scripts/wait_for_ci_build
1923
)
24+
25+
# Push, open PR, approve staging deploy, and wait for CI build to finish
26+
gpsps() (
27+
set -euo pipefail
28+
_git_push_create_pr_and_open_pipeline "$@"
29+
./scripts/ci/approve staging
30+
[ -f scripts/wait_for_ci_build ] && scripts/wait_for_ci_build
31+
)
32+
33+
alias gpssp='gpsps'

bin/git-clean-branches

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ main() {
147147
if [ -n "$worktree_path" ]; then
148148
echo " Removing worktree at: $worktree_path"
149149

150+
# Remove submodules from worktree first to avoid Git errors
151+
remove_worktree_submodules "$worktree_path"
152+
150153
# Use remove_worktree script if available, otherwise use git worktree remove
151154
if has_remove_worktree_script "$main_repo"; then
152155
(cd "$main_repo" && ./scripts/remove_worktree "$branch")

0 commit comments

Comments
 (0)