jenkins: initial import

This commit is contained in:
Jose V Beneyto 2015-02-20 15:19:55 +00:00
parent adf2b4151e
commit 5a1977d4a5
6 changed files with 236 additions and 0 deletions

16
jenkins/.footprint Normal file
View File

@ -0,0 +1,16 @@
drwxr-xr-x root/root etc/
drwxr-xr-x root/root etc/rc.d/
-rwxr-xr-x root/root etc/rc.d/jenkins
drwxr-xr-x root/root usr/
drwxr-xr-x root/root usr/etc/
-rw-r--r-- root/root usr/etc/jenkins.conf
drwxr-xr-x root/root usr/lib/
drwxr-xr-x root/root usr/lib/jenkins/
-r--r--r-- root/root usr/lib/jenkins/jenkins.war
drwxr-xr-x root/root var/
drwxr-xr-x root/root var/cache/
drwxr-xr-x jenkins/jenkins var/cache/jenkins/
drwxr-xr-x root/root var/lib/
drwxr-xr-x jenkins/jenkins var/lib/jenkins/
drwxr-xr-x root/root var/log/
drwxr-xr-x jenkins/jenkins var/log/jenkins/

3
jenkins/.md5sum Normal file
View File

@ -0,0 +1,3 @@
9a39a724f6de3fb4da9d01c672a05345 jenkins.conf
f9667704d220576e2ff3f30b74982c99 jenkins.rc
2a2c23c24b0295e52a28c56ed8abcdfb jenkins.war

18
jenkins/Pkgfile Normal file
View File

@ -0,0 +1,18 @@
# Description: An extensible open source continuous integration server
# URL: http://jenkins-ci.org/
# Maintainer: Jose V Beneyto, sepen at crux dot nu
# Packager: Jose V Beneyto, sepen at crux dot nu
# Depends on: jdk
name=jenkins
version=1.599
release=1
source=(http://mirrors.jenkins-ci.org/war/$version/$name.war \
$name.rc $name.conf)
build() {
install -D -m 0444 $name.war $PKG/usr/lib/$name/$name.war
install -D -m 0644 $name.conf $PKG/usr/etc/$name.conf
install -D -m 0755 $name.rc $PKG/etc/rc.d/$name
install -d -m 0755 -o $name -g $name $PKG/var/{cache,lib,log}/$name
}

142
jenkins/jenkins.conf Normal file
View File

@ -0,0 +1,142 @@
## Path: Development/Jenkins
## Description: Configuration for the Jenkins continuous build server
## Type: string
## Default: "/var/lib/jenkins"
## ServiceRestart: jenkins
#
# Directory where Jenkins store its configuration and working
# files (checkouts, build reports, artifacts, ...).
#
JENKINS_HOME="/var/lib/jenkins"
## Type: string
## Default: "jenkins"
## ServiceRestart: jenkins
#
# Unix user account that runs the Jenkins daemon
# Be careful when you change this, as you need to update
# permissions of $JENKINS_HOME and /var/log/jenkins.
#
JENKINS_USER="jenkins"
## Type: string
## Default: "-Djava.awt.headless=true"
## ServiceRestart: jenkins
#
# Options to pass to java when running Jenkins.
#
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Dorg.apache.commons.jelly.tags.fmt.timeZone=Europe/Madrid"
## Type: integer(0:65535)
## Default: 8080
## ServiceRestart: jenkins
#
# Port Jenkins is listening on.
# Set to -1 to disable
#
JENKINS_PORT="8080"
## Type: string
## Default: ""
## ServiceRestart: jenkins
#
# IP address Jenkins listens on for HTTP requests.
# Default is all interfaces (0.0.0.0).
#
JENKINS_LISTEN_ADDRESS=""
## Type: integer(0:65535)
## Default: ""
## ServiceRestart: jenkins
#
# HTTPS port Jenkins is listening on.
# Default is disabled.
#
JENKINS_HTTPS_PORT=""
## Type: string
## Default: ""
## ServiceRestart: jenkins
#
# Path to the keystore in JKS format (as created by the JDK 'keytool').
# Default is disabled.
#
JENKINS_HTTPS_KEYSTORE=""
## Type: string
## Default: ""
## ServiceRestart: jenkins
#
# Password to access the keystore defined in JENKINS_HTTPS_KEYSTORE.
# Default is disabled.
#
JENKINS_HTTPS_KEYSTORE_PASSWORD=""
## Type: string
## Default: ""
## ServiceRestart: jenkins
#
# IP address Jenkins listens on for HTTPS requests.
# Default is disabled.
#
JENKINS_HTTPS_LISTEN_ADDRESS=""
## Type: integer(0:65535)
## Default: 8009
## ServiceRestart: jenkins
#
# Ajp13 Port Jenkins is listening on.
# Set to -1 to disable
#
JENKINS_AJP_PORT="-1"
## Type: string
## Default: ""
## ServiceRestart: jenkins
#
# IP address Jenkins listens on for Ajp13 requests.
# Default is all interfaces (0.0.0.0).
#
JENKINS_AJP_LISTEN_ADDRESS=""
## Type: integer(1:9)
## Default: 5
## ServiceRestart: jenkins
#
# Debug level for logs -- the higher the value, the more verbose.
# 5 is INFO.
#
JENKINS_DEBUG_LEVEL="5"
## Type: yesno
## Default: no
## ServiceRestart: jenkins
#
# Whether to enable access logging or not.
#
JENKINS_ENABLE_ACCESS_LOG="no"
## Type: integer
## Default: 100
## ServiceRestart: jenkins
#
# Maximum number of HTTP worker threads.
#
JENKINS_HANDLER_MAX="100"
## Type: integer
## Default: 20
## ServiceRestart: jenkins
#
# Maximum number of idle HTTP worker threads.
#
JENKINS_HANDLER_IDLE="20"
## Type: string
## Default: ""
## ServiceRestart: jenkins
#
# Pass arbitrary arguments to Jenkins.
# Full option list: java -jar jenkins.war --help
#
JENKINS_ARGS=""

47
jenkins/jenkins.rc Normal file
View File

@ -0,0 +1,47 @@
#!/bin/sh
JENKINS_WAR="/usr/lib/jenkins/jenkins.war"
JENKINS_CONFIG="/usr/etc/jenkins.conf"
JENKINS_PID_FILE="/var/run/jenkins.pid"
[ -f "$JENKINS_CONFIG" ] && . "$JENKINS_CONFIG"
JAVA_CMD="/usr/bin/java $JENKINS_JAVA_OPTIONS -DJENKINS_HOME=$JENKINS_HOME -jar $JENKINS_WAR"
PARAMS="--daemon --logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins"
[ -n "$JENKINS_PORT" ] && PARAMS="$PARAMS --httpPort=$JENKINS_PORT"
[ -n "$JENKINS_LISTEN_ADDRESS" ] && PARAMS="$PARAMS --httpListenAddress=$JENKINS_LISTEN_ADDRESS"
[ -n "$JENKINS_HTTPS_PORT" ] && PARAMS="$PARAMS --httpsPort=$JENKINS_HTTPS_PORT"
[ -n "$JENKINS_HTTPS_KEYSTORE" ] && PARAMS="$PARAMS --httpsKeyStore=$JENKINS_HTTPS_KEYSTORE"
[ -n "$JENKINS_HTTPS_KEYSTORE_PASSWORD" ] && PARAMS="$PARAMS --httpsKeyStorePassword='$JENKINS_HTTPS_KEYSTORE_PASSWORD'"
[ -n "$JENKINS_HTTPS_LISTEN_ADDRESS" ] && PARAMS="$PARAMS --httpsListenAddress=$JENKINS_HTTPS_LISTEN_ADDRESS"
[ -n "$JENKINS_AJP_PORT" ] && PARAMS="$PARAMS --ajp13Port=$JENKINS_AJP_PORT"
[ -n "$JENKINS_AJP_LISTEN_ADDRESS" ] && PARAMS="$PARAMS --ajp13ListenAddress=$JENKINS_AJP_LISTEN_ADDRESS"
[ -n "$JENKINS_DEBUG_LEVEL" ] && PARAMS="$PARAMS --debug=$JENKINS_DEBUG_LEVEL"
[ -n "$JENKINS_HANDLER_STARTUP" ] && PARAMS="$PARAMS --handlerCountStartup=$JENKINS_HANDLER_STARTUP"
[ -n "$JENKINS_HANDLER_MAX" ] && PARAMS="$PARAMS --handlerCountMax=$JENKINS_HANDLER_MAX"
[ -n "$JENKINS_HANDLER_IDLE" ] && PARAMS="$PARAMS --handlerCountMaxIdle=$JENKINS_HANDLER_IDLE"
[ -n "$JENKINS_ARGS" ] && PARAMS="$PARAMS $JENKINS_ARGS"
if [ "$JENKINS_ENABLE_ACCESS_LOG" = "yes" ]; then
PARAMS="$PARAMS --accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=combined --simpleAccessLogger.file=/var/log/jenkins/access_log"
fi
case $1 in
start)
/usr/bin/su -c "$JAVA_CMD $PARAMS >/dev/null" jenkins
/usr/bin/pgrep -a java | grep jenkins | cut -d' ' -f1 >$JENKINS_PID_FILE
;;
stop)
kill -9 $(cat $JENKINS_PID_FILE) 2>/dev/null
;;
restart)
$0 stop
sleep 2
$0 start
;;
*)
echo "Usage: $0 [start|stop|restart]"
;;
esac
# End of file

10
jenkins/pre-install Normal file
View File

@ -0,0 +1,10 @@
#!/bin/sh
user="jenkins"
group="jenkins"
home="/var/lib/$user"
/usr/bin/getent group $group >/dev/null || /usr/sbin/groupadd $group
/usr/bin/getent passwd $user >/dev/null || /usr/sbin/useradd -s /sbin/nologin -d $home -g $group $user
# End of file