|
#!/bin/bash |
|
|
|
### |
|
# |
|
# Copyright (c) 2013 KimSia Sim |
|
# |
|
# Run this by executing the following after you have installed Jenkins and you have generated a pair of public/private keys |
|
# added it to your user account in Jenkins, ensured that the user has permissions to install the plugins, |
|
# and run the command: |
|
# |
|
# java -jar jenkins-cli.jar -s http://localhost:8080 -i {PRIVATE_KEY_PATH} login |
|
# |
|
# before running: |
|
# |
|
# bash -c "$(curl -fsSL https://gist.githubusercontent.com/simkimsia/4491019/raw/install-cakephp-ci-related-jenkins-plugins.sh)" |
|
# |
|
# |
|
# Its handy to install 'screen' if you want to ensure your remote connection to |
|
# a server doesn't disrupt the installation process. If you want to do this, just |
|
# do the following before running the main bash command: |
|
# |
|
# apt-get install screen -y |
|
# screen |
|
# |
|
# To recover your session if you are disconnected, ssh to your server as root again, |
|
# and type: |
|
# |
|
# screen -x |
|
# |
|
# Dependencies: |
|
# - curl |
|
# - installed jenkins CLI plugin |
|
# - executed login using ssh keys |
|
# |
|
# Todo: |
|
# - SSL Configuration |
|
# |
|
### |
|
|
|
|
|
export DEBIAN_FRONTEND=noninteractive |
|
|
|
########################################################################################## |
|
## If you get a shortname not found situation, you need to update the updatecenter. |
|
## You need to at the very least, allow Anonymous READ in your Configure Global Security. |
|
## Then, run the following statement: |
|
## |
|
## curl -L http://updates.jenkins-ci.org/update-center.json | sed '1d;$d' | curl -X POST -H 'Accept: application/json' -d @- http://localhost:8080/updateCenter/byId/default/postBack |
|
## |
|
## |
|
########################################################################################## |
|
|
|
|
|
#################################################################################### |
|
## The list of plugins to install |
|
#################################################################################### |
|
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin checkstyle |
|
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin cloverphp |
|
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin dry |
|
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin htmlpublisher |
|
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin jdepend |
|
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin plot |
|
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin pmd |
|
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin violations |
|
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin xunit |
|
|
|
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin github |
|
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin phing |
|
|
|
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin git |
|
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin greenballs |
|
|
|
### build stats related plugins |
|
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin global-build-stats |
|
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin build-metrics |
|
|
|
|
|
## it is important that AFTER the last plugin we prompt for restart of the jenkins server |
|
java -jar jenkins-cli.jar -s http://localhost:8080 safe-restart |