-
-
Save alexmerser/ddd3884f88285fc1db36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/sbin/groupadd -g 30119 jenkins | |
/usr/sbin/useradd -u 30119 -g jenkins jenkins | |
mkdir /home/jenkins | |
# Download Play! to /home/jenkins | |
chown -R jenkins. /home/jenkins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir /usr/local/jenkins | |
chown -R jenkins. /usr/local/jenkins | |
chmod a+x /usr/local/jenkins/start-jenkins.sh | |
chmod a+x /usr/local/jenkins/stop-jenkins.sh | |
chmod a+x /etc/init.d/jenkins | |
chkconfig --add jenkins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://mirrors.jenkins-ci.org/war/latest/jenkins.war | |
sudo mkdir /usr/local/jenkins | |
sudo cp jenkins.war /usr/local/jenkins/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# chkconfig: 2345 90 30 | |
# description: Start/Stop the Jenkins Continuous Integration server. | |
# Source function library. | |
. /etc/rc.d/init.d/functions | |
# Get config. | |
. /etc/sysconfig/network | |
# Check that networking is up. | |
[ "${NETWORKING}" = "no" ] && exit 0 | |
startup=/usr/local/jenkins/start-jenkins.sh | |
shutdown=/usr/local/jenkins/stop-jenkins.sh | |
export JAVA_HOME=/usr/lib/jvm/java | |
JENKINS_USER=jenkins | |
start(){ | |
echo -n $"Starting Jenkins service: " | |
su - $JENKINS_USER -c $startup | |
RETVAL=$? | |
echo | |
} | |
stop(){ | |
action $"Stopping Jenkins service: " | |
su - $JENKINS_USER -c $shutdown | |
RETVAL=$? | |
echo | |
} | |
status(){ | |
numproc=`ps -ef | grep [j]enkins.war | wc -l` | |
if [ $numproc -gt 0 ]; then | |
echo "Jenkins is running..." | |
else | |
echo "Jenkins is stopped..." | |
fi | |
} | |
restart(){ | |
stop | |
sleep 5 | |
start | |
} | |
# See how we were called. | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
status) | |
status | |
;; | |
restart) | |
restart | |
;; | |
*) | |
echo $"Usage: $0 {start|stop|status|restart}" | |
exit 1 | |
esac | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
JENKINS_WAR=/usr/local/jenkins/jenkins.war | |
JENKINS_LOG=/home/jenkins/jenkins.log | |
JAVA=/usr/bin/java | |
nohup nice $JAVA -jar $JENKINS_WAR --httpPort=8081 > $JENKINS_LOG 2>&1 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
kill `ps -ef | grep [j]enkins.war | awk '{ print $2 }'` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment