Skip to content

Commit 4c3f451

Browse files
Script Fix
1 parent bbdf359 commit 4c3f451

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

lib/deploy.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@ deploy_command() {
2020
_deploy_run() {
2121
local app="$1" home="/home/${app}"
2222
local df="${home}/.deployer/deploy.php"
23-
[[ ! -f "$df" ]] && { error "Deployer config not found: $df"; exit 1; }
23+
if [[ ! -f "$df" ]]; then
24+
step "Creating deployer config..."
25+
source "${CIPI_LIB}/app.sh"
26+
local repo branch php_ver
27+
repo=$(app_get "$app" repository)
28+
branch=$(app_get "$app" branch)
29+
php_ver=$(app_get "$app" php)
30+
[[ -z "$repo" || -z "$php_ver" ]] && { error "App config incomplete (repository/php). Run: cipi app edit $app"; exit 1; }
31+
_create_deployer_config "$app" "${repo}" "${branch:-main}" "$php_ver"
32+
success "Deployer config created"
33+
fi
2434

2535
info "Deploying '${app}'..."
2636
echo ""

0 commit comments

Comments
 (0)