22 lines
584 B
Bash
22 lines
584 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
log() { echo "[start] $(date -Is) $*"; }
|
|
abort() { echo "[start] ERROR: $*" >&2; exit 1; }
|
|
|
|
# Defaults
|
|
: "${APP_PORT:=8080}"
|
|
: "${JENKINS_HOME:=/app/data/jenkins_home}"
|
|
|
|
log "Starting Jenkins CI/CD on port ${APP_PORT}"
|
|
|
|
# Ensure Jenkins home directory exists and is writable
|
|
mkdir -p "${JENKINS_HOME}"
|
|
chown -R cloudron:cloudron /app/data || true
|
|
|
|
# Set Jenkins environment variables
|
|
export JENKINS_HOME
|
|
export JENKINS_OPTS="--httpPort=${APP_PORT} --httpListenAddress=0.0.0.0"
|
|
|
|
log "Starting Jenkins WAR file"
|
|
exec java -jar /app/pkg/jenkins.war |