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:
|
ENVIRONMENT:
|
||||||
GIT_SHA Git commit SHA (default: current HEAD)
|
GIT_SHA Git commit SHA (default: current HEAD)
|
||||||
|
|
||||||
|
NOTE:
|
||||||
|
On macOS, the script will automatically launch in a new iTerm window.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
@@ -307,6 +310,30 @@ run_jobs() {
|
|||||||
log_success "All jobs completed successfully"
|
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() {
|
deploy() {
|
||||||
if [ "$DEPLOY_FLAG" = false ]; then
|
if [ "$DEPLOY_FLAG" = false ]; then
|
||||||
log_info "Deployment skipped (use --deploy flag to enable)"
|
log_info "Deployment skipped (use --deploy flag to enable)"
|
||||||
@@ -324,6 +351,8 @@ deploy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
local original_args=("$@")
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
--deploy)
|
--deploy)
|
||||||
@@ -355,6 +384,10 @@ main() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$(uname)" = "Darwin" ] && [ -z "$PIPELINE_IN_ITERM" ]; then
|
||||||
|
launch_in_iterm "${original_args[@]}"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "==================== CI/CD PIPELINE ===================="
|
echo "==================== CI/CD PIPELINE ===================="
|
||||||
log_info "Pipeline started at $(date)"
|
log_info "Pipeline started at $(date)"
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
Reference in New Issue
Block a user