Vincent Latombe | c14af95 | 2016-07-18 10:20:12 +0200 | [diff] [blame] | 1 | #! /bin/bash -e |
Nicolas De Loof | d606438 | 2014-10-04 08:17:28 +0200 | [diff] [blame] | 2 | |
Dave Head-Rapson | 595a468 | 2016-02-29 13:41:53 +0000 | [diff] [blame] | 3 | : ${JENKINS_HOME:="/var/jenkins_home"} |
Carlos Sanchez | bd2f6c9 | 2016-01-14 09:15:47 +0100 | [diff] [blame] | 4 | touch "${COPY_REFERENCE_FILE_LOG}" || (echo "Can not write to ${COPY_REFERENCE_FILE_LOG}. Wrong volume permissions?" && exit 1) |
Kanstantsin Shautsou | 4409632 | 2015-12-11 02:21:20 +0300 | [diff] [blame] | 5 | echo "--- Copying files at $(date)" >> "$COPY_REFERENCE_FILE_LOG" |
Vincent Latombe | c14af95 | 2016-07-18 10:20:12 +0200 | [diff] [blame] | 6 | find /usr/share/jenkins/ref/ -type f -exec bash -c ". /usr/local/bin/jenkins-support; copy_reference_file '{}'" \; |
Nicolas De Loof | acb8649 | 2014-10-24 13:43:13 +0200 | [diff] [blame] | 7 | |
Jakub Pavlik | a067c49 | 2016-09-01 15:18:03 +0200 | [diff] [blame^] | 8 | cat /tmp/org.codefirst.SimpleThemeDecorator.xml | envsubst > $JENKINS_HOME/org.codefirst.SimpleThemeDecorator.xml |
| 9 | |
Filip Pytloun | e9e6f56 | 2016-08-31 16:30:33 +0200 | [diff] [blame] | 10 | cat << EOF >>/usr/share/jenkins/ref/init.groovy.d/executors.groovy |
| 11 | import jenkins.model.* |
| 12 | Jenkins.instance.setNumExecutors(${JENKINS_NUM_EXECUTORS:-2}) |
| 13 | EOF |
| 14 | |
Nicolas De Loof | 07c307d | 2014-10-07 14:02:42 +0200 | [diff] [blame] | 15 | # if `docker run` first argument start with `--` the user is passing jenkins launcher arguments |
| 16 | if [[ $# -lt 1 ]] || [[ "$1" == "--"* ]]; then |
Carlos Sanchez | e7d56fa | 2016-02-29 13:55:33 +0100 | [diff] [blame] | 17 | eval "exec java $JAVA_OPTS -jar /usr/share/jenkins/jenkins.war $JENKINS_OPTS \"\$@\"" |
Nicolas De Loof | 07c307d | 2014-10-07 14:02:42 +0200 | [diff] [blame] | 18 | fi |
| 19 | |
| 20 | # As argument is not jenkins, assume user want to run his own process, for sample a `bash` shell to explore this image |
Nicolas De loof | b2b442e | 2014-10-08 08:05:02 +0200 | [diff] [blame] | 21 | exec "$@" |