1 Star 0 Fork 30

陆雅亮/jenkins

forked from csphere/jenkins 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
jenkins.sh 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
csphere 提交于 2015-09-23 12:57 . first commit
#! /bin/bash
set -e
# Copy files from /usr/share/jenkins/ref into /var/jenkins_home
# So the initial JENKINS-HOME is set with expected content.
# Don't override, as this is just a reference setup, and use from UI
# can then change this, upgrade plugins, etc.
copy_reference_file() {
f=${1%/}
echo "$f" >> $COPY_REFERENCE_FILE_LOG
rel=${f:23}
dir=$(dirname ${f})
echo " $f -> $rel" >> $COPY_REFERENCE_FILE_LOG
if [[ ! -e /var/jenkins_home/${rel} ]]
then
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};
# pin plugins on initial copy
[[ ${rel} == plugins/*.jpi ]] && touch /var/jenkins_home/${rel}.pinned
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
if [[ $# -lt 1 ]] || [[ "$1" == "--"* ]]; then
exec java $JAVA_OPTS -jar /usr/share/jenkins/jenkins.war $JENKINS_OPTS "$@"
fi
# As argument is not jenkins, assume user want to run his own process, for sample a `bash` shell to explore this image
exec "$@"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cyalu/jenkins.git
git@gitee.com:cyalu/jenkins.git
cyalu
jenkins
jenkins
master

搜索帮助