blob: a7177954257c91e8ed7fe7aa1630bc3d85dbc3cb [file] [log] [blame]
Vincent Latombec14af952016-07-18 10:20:12 +02001#! /bin/bash -e
Nicolas De Loofd6064382014-10-04 08:17:28 +02002
Dave Head-Rapson595a4682016-02-29 13:41:53 +00003: ${JENKINS_HOME:="/var/jenkins_home"}
Carlos Sanchezbd2f6c92016-01-14 09:15:47 +01004touch "${COPY_REFERENCE_FILE_LOG}" || (echo "Can not write to ${COPY_REFERENCE_FILE_LOG}. Wrong volume permissions?" && exit 1)
Kanstantsin Shautsou44096322015-12-11 02:21:20 +03005echo "--- Copying files at $(date)" >> "$COPY_REFERENCE_FILE_LOG"
Vincent Latombec14af952016-07-18 10:20:12 +02006find /usr/share/jenkins/ref/ -type f -exec bash -c ". /usr/local/bin/jenkins-support; copy_reference_file '{}'" \;
Nicolas De Loofacb86492014-10-24 13:43:13 +02007
Filip Pytloune9e6f562016-08-31 16:30:33 +02008cat << EOF >>/usr/share/jenkins/ref/init.groovy.d/executors.groovy
9import jenkins.model.*
10Jenkins.instance.setNumExecutors(${JENKINS_NUM_EXECUTORS:-2})
11EOF
12
Nicolas De Loof07c307d2014-10-07 14:02:42 +020013# if `docker run` first argument start with `--` the user is passing jenkins launcher arguments
14if [[ $# -lt 1 ]] || [[ "$1" == "--"* ]]; then
Carlos Sancheze7d56fa2016-02-29 13:55:33 +010015 eval "exec java $JAVA_OPTS -jar /usr/share/jenkins/jenkins.war $JENKINS_OPTS \"\$@\""
Nicolas De Loof07c307d2014-10-07 14:02:42 +020016fi
17
18# As argument is not jenkins, assume user want to run his own process, for sample a `bash` shell to explore this image
Nicolas De loofb2b442e2014-10-08 08:05:02 +020019exec "$@"