forked from kitconcept/jenkins-pipeline-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
provisioning.sh
38 lines (38 loc) · 2.77 KB
/
provisioning.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
pip install robotframework
pip install robotframework-selenium2library
wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install -y jenkins
sudo service jenkins restart
sleep 10
while [[ ! -f /var/lib/jenkins/config.xml ]]; do sleep 2; done;
sudo -u jenkins sed -i "s@<useSecurity>true<\/useSecurity>@<useSecurity>false<\/useSecurity>@g" /var/lib/jenkins/config.xml
# enable JNLP port, see https://github.com/aespinosa/docker-jenkins/issues/24
sudo -u jenkins sed -i "s@<slaveAgentPort>.*@<slaveAgentPort>49153</slaveAgentPort>@g" /var/lib/jenkins/config.xml
sudo -u jenkins cp /var/lib/jenkins/jenkins.install.UpgradeWizard.state /var/lib/jenkins/jenkins.install.InstallUtil.lastExecVersion
sudo service jenkins restart
sleep 10
while [[ $(curl -s -w "%{http_code}" http://localhost:8080 -o /dev/null) != "200" ]]; do sleep 5; done;
sudo wget http://localhost:8080/jnlpJars/jenkins-cli.jar
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin git
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin checkstyle
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin workflow-aggregator
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin workflow-api
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin workflow-basic-steps
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin workflow-cps
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin workflow-cps-global-lib
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin workflow-durable-task-step
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin workflow-job
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin workflow-scm-step
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin workflow-step-api
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin workflow-support
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin pipeline-stage-view
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin jquery-detached # pipeline-stage-view dep
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin momentjs # pipeline-stage-view dep
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin handlebars # pipeline-stage-view dep
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin pipeline-rest-api # pipeline-stage-view dep
sudo service jenkins restart
sleep 10
while [[ $(curl -s -w "%{http_code}" http://localhost:8080 -o /dev/null) != "200" ]]; do sleep 5; done;
java -jar jenkins-cli.jar -s http://localhost:8080 create-job pipeline < /home/vagrant/jenkins-pipeline-examples/pipeline.xml