fix(pipeline): Launch in external iTerm window to overcome deployment issue
This commit is contained in:
33
pipeline.sh
33
pipeline.sh
@@ -65,6 +65,9 @@ EXAMPLES:
|
||||
ENVIRONMENT:
|
||||
GIT_SHA Git commit SHA (default: current HEAD)
|
||||
|
||||
NOTE:
|
||||
On macOS, the script will automatically launch in a new iTerm window.
|
||||
|
||||
EOF
|
||||
exit 0
|
||||
}
|
||||
@@ -307,6 +310,30 @@ run_jobs() {
|
||||
log_success "All jobs completed successfully"
|
||||
}
|
||||
|
||||
launch_in_iterm() {
|
||||
log_info "Launching pipeline in new iTerm window..."
|
||||
|
||||
local script_path="$0"
|
||||
local args=""
|
||||
|
||||
for arg in "$@"; do
|
||||
args="$args $arg"
|
||||
done
|
||||
|
||||
osascript <<EOF
|
||||
tell application "iTerm"
|
||||
create window with default profile
|
||||
tell current session of current window
|
||||
write text "cd '$SCRIPT_DIR' && PIPELINE_IN_ITERM=1 bash '$script_path'$args"
|
||||
end tell
|
||||
activate
|
||||
end tell
|
||||
EOF
|
||||
|
||||
log_success "Pipeline launched in iTerm window"
|
||||
exit 0
|
||||
}
|
||||
|
||||
deploy() {
|
||||
if [ "$DEPLOY_FLAG" = false ]; then
|
||||
log_info "Deployment skipped (use --deploy flag to enable)"
|
||||
@@ -324,6 +351,8 @@ deploy() {
|
||||
}
|
||||
|
||||
main() {
|
||||
local original_args=("$@")
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--deploy)
|
||||
@@ -355,6 +384,10 @@ main() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$(uname)" = "Darwin" ] && [ -z "$PIPELINE_IN_ITERM" ]; then
|
||||
launch_in_iterm "${original_args[@]}"
|
||||
fi
|
||||
|
||||
echo "==================== CI/CD PIPELINE ===================="
|
||||
log_info "Pipeline started at $(date)"
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user