@@ -317,53 +317,46 @@ jobs:
317317 log_success "Container started with ID: $(docker ps --filter name=$CONTAINER_NAME -q)"
318318 }
319319
320- validate_container_health() {
321- local max_attempts=40
322- local attempt=1
323- local initial_wait=5
324- log_info "Validating container health (max ${max_attempts} attempts, initial wait ${initial_wait}s)..."
325-
326- # Wait for app to start
327- log_info "Giving application time to start (${initial_wait}s)..."
328- sleep $initial_wait
329-
330- while [ $attempt -le $max_attempts ]; do
331- if container_running "$CONTAINER_NAME"; then
332- local status=$(docker inspect "$CONTAINER_NAME" --format='{{.State.Status}}')
333- if [ "$status" = "running" ]; then
334- # Try to hit health endpoint
335- local health_response=$(docker exec "$CONTAINER_NAME" curl -s -w "\n%{http_code}" http://localhost:8080/actuator/health 2>&1)
336- local http_code=$(echo "$health_response" | tail -n 1)
337- local body=$(echo "$health_response" | head -n -1)
338-
339- if [ "$http_code" = "200" ]; then
340- log_success "Container is healthy (HTTP $http_code)"
341- log_info "Health response: $body"
342- return 0
343- else
344- log_info "Health endpoint returned HTTP $http_code (attempt ${attempt}/${max_attempts})"
345- fi
346- elif [ "$status" = "exited" ]; then
347- log_error "Container exited (attempt ${attempt}/${max_attempts})"
348- log_error "Recent logs:"
349- docker logs --tail 30 "$CONTAINER_NAME" 2>&1 | sed 's/^/ /'
350- return 1
351- else
352- log_warn "Container status is: $status (attempt ${attempt}/${max_attempts})"
353- fi
354- else
355- log_warn "Container not found (attempt ${attempt}/${max_attempts})"
356- fi
357-
358- sleep 2
359- attempt=$((attempt + 1))
360- done
361-
362- log_error "Container failed health check after ${max_attempts} attempts"
363- log_error "Final container logs:"
364- docker logs --tail 50 "$CONTAINER_NAME" 2>&1 | sed 's/^/ /'
365- return 1
366- }
320+ # HEALTH CHECK TEMPORARILY DISABLED
321+ # validate_container_health() {
322+ # local max_attempts=40
323+ # local attempt=1
324+ # local initial_wait=5
325+ # log_info "Validating container health (max ${max_attempts} attempts, initial wait ${initial_wait}s)..."
326+ # sleep $initial_wait
327+ # while [ $attempt -le $max_attempts ]; do
328+ # if container_running "$CONTAINER_NAME"; then
329+ # local status=$(docker inspect "$CONTAINER_NAME" --format='{{.State.Status}}')
330+ # if [ "$status" = "running" ]; then
331+ # local health_response=$(docker exec "$CONTAINER_NAME" curl -s -w "\n%{http_code}" http://localhost:8080/actuator/health 2>&1)
332+ # local http_code=$(echo "$health_response" | tail -n 1)
333+ # local body=$(echo "$health_response" | head -n -1)
334+ # if [ "$http_code" = "200" ]; then
335+ # log_success "Container is healthy (HTTP $http_code)"
336+ # log_info "Health response: $body"
337+ # return 0
338+ # else
339+ # log_info "Health endpoint returned HTTP $http_code (attempt ${attempt}/${max_attempts})"
340+ # fi
341+ # elif [ "$status" = "exited" ]; then
342+ # log_error "Container exited (attempt ${attempt}/${max_attempts})"
343+ # log_error "Recent logs:"
344+ # docker logs --tail 30 "$CONTAINER_NAME" 2>&1 | sed 's/^/ /'
345+ # return 1
346+ # else
347+ # log_warn "Container status is: $status (attempt ${attempt}/${max_attempts})"
348+ # fi
349+ # else
350+ # log_warn "Container not found (attempt ${attempt}/${max_attempts})"
351+ # fi
352+ # sleep 2
353+ # attempt=$((attempt + 1))
354+ # done
355+ # log_error "Container failed health check after ${max_attempts} attempts"
356+ # log_error "Final container logs:"
357+ # docker logs --tail 50 "$CONTAINER_NAME" 2>&1 | sed 's/^/ /'
358+ # return 1
359+ # }
367360
368361 cleanup_old_container() {
369362 log_info "Cleaning up old container..."
0 commit comments