Skip to content

Instantly share code, notes, and snippets.

@snoby
Created August 26, 2016 17:37
Show Gist options
  • Save snoby/7944d188a2548f30f0ff58d17453c148 to your computer and use it in GitHub Desktop.
Save snoby/7944d188a2548f30f0ff58d17453c148 to your computer and use it in GitHub Desktop.
Installation of jenkins plugins
#!/bin/bash
set -e
PLUGINS_ENDPOINT=http://updates.jenkins-ci.org/latest/
DATA=/var/lib/jenkins
mkdir -p $DATA/plugins
if find $DATA/plugins -maxdepth 0 -empty | read v; then
(cd $DATA/plugins && wget --no-check-certificate $PLUGINS_ENDPOINT/hipchat.hpi)
(cd $DATA/plugins && wget --no-check-certificate $PLUGINS_ENDPOINT/greenballs.hpi)
(cd $DATA/plugins && wget --no-check-certificate $PLUGINS_ENDPOINT/credentials.hpi)
(cd $DATA/plugins && wget --no-check-certificate $PLUGINS_ENDPOINT/ssh-credentials.hpi)
(cd $DATA/plugins && wget --no-check-certificate $PLUGINS_ENDPOINT/ssh-agent.hpi)
(cd $DATA/plugins && wget --no-check-certificate $PLUGINS_ENDPOINT/git-client.hpi)
(cd $DATA/plugins && wget --no-check-certificate $PLUGINS_ENDPOINT/git.hpi)
(cd $DATA/plugins && wget --no-check-certificate $PLUGINS_ENDPOINT/github.hpi)
(cd $DATA/plugins && wget --no-check-certificate $PLUGINS_ENDPOINT/github-api.hpi)
(cd $DATA/plugins && wget --no-check-certificate $PLUGINS_ENDPOINT/ghprb.hpi)
(cd $DATA/plugins && wget --no-check-certificate $PLUGINS_ENDPOINT/github-oauth.hpi)
(cd $DATA/plugins && wget --no-check-certificate $PLUGINS_ENDPOINT/scm-api.hpi)
(cd $DATA/plugins && wget --no-check-certificate $PLUGINS_ENDPOINT/postbuild-task.hpi)
fi
chown -R jenkins $DATA
exec su jenkins -c "java -jar /usr/share/jenkins/jenkins.war"
Contact GitHub API Training Shop Blog About
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment