Merge pull request #89 from jenkinsci/quiet
Make copy_reference_file quieter
diff --git a/Dockerfile b/Dockerfile
index b7e21bd..360d90d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -36,6 +36,9 @@
# will be used by attached slave agents:
EXPOSE 50000
+ENV COPY_REFERENCE_FILE_LOG /var/log/copy_reference_file.log
+RUN touch $COPY_REFERENCE_FILE_LOG && chown jenkins.jenkins $COPY_REFERENCE_FILE_LOG
+
USER jenkins
COPY jenkins.sh /usr/local/bin/jenkins.sh
diff --git a/jenkins.sh b/jenkins.sh
index 1bd0f85..da0dd65 100755
--- a/jenkins.sh
+++ b/jenkins.sh
@@ -6,18 +6,19 @@
# can then change this, upgrade plugins, etc.
copy_reference_file() {
f=${1%/}
- echo "$f"
+ echo "$f" >> $COPY_REFERENCE_FILE_LOG
rel=${f:23}
dir=$(dirname ${f})
- echo " $f -> $rel"
+ echo " $f -> $rel" >> $COPY_REFERENCE_FILE_LOG
if [[ ! -e /var/jenkins_home/${rel} ]]
then
- echo "copy $rel to JENKINS_HOME"
+ echo "copy $rel to JENKINS_HOME" >> $COPY_REFERENCE_FILE_LOG
mkdir -p /var/jenkins_home/${dir:23}
cp -r /usr/share/jenkins/ref/${rel} /var/jenkins_home/${rel};
fi;
}
export -f copy_reference_file
+echo "--- Copying files at $(date)" >> $COPY_REFERENCE_FILE_LOG
find /usr/share/jenkins/ref/ -type f -exec bash -c 'copy_reference_file {}' \;
# if `docker run` first argument start with `--` the user is passing jenkins launcher arguments