-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjenkins.sh
35 lines (33 loc) · 1.83 KB
/
jenkins.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
#!/bin/sh
#Debian user
USER=user
#Jenkins host
JENKINSHOST=jenkins.localhost
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add -
echo "deb http://pkg.jenkins-ci.org/debian binary/" >> /etc/apt/sources.list.d/jenkins.list
apt-get update
apt-get -y install jenkins
/etc/init.d/jenkins start
apt-get -y install xvfb gtk2-engines-pixbuf
apt-get -y install xfonts-base xfonts-75dpi xfonts-100dpi
apt-get -y install xfonts-scalable xfonts-cyrillic
apt-get -y install x11-apps imagemagick
apt-get -y install ttf-liberation
apt-get -y install x-window-system-core
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
cat /etc/apt/sources.list.d/google-chrome.list
apt-get update && apt-get upgrade
apt-get install -y xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic xvfb x11-apps
apt-get -y install google-chrome-stable
wget http://chromedriver.storage.googleapis.com/2.20/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
mv chromedriver /usr/local/bin/chromedriver
rm chromedriver_linux64.zip
/bin/su - $USER -c "wget https://raw.githubusercontent.com/antonchernik/lnmp-debian/master/nginx/jenkins.conf -P /home/$USER/conf/nginx/sites-enabled"
/bin/su - $USER -c "wget https://raw.githubusercontent.com/antonchernik/lnmp-debian/master/nginx/upstream-jenkins.conf -P /home/$USER/conf/nginx/upstream"
sed -i -e "s/jenkins.localhost/$JENKINSHOST/g" /home/$USER/conf/nginx/sites-enabled/jenkins.conf
/etc/init.d/nginx restart
wget http://localhost:8080/jnlpJars/jenkins-cli.jar
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin checkstyle cloverphp crap4j dry htmlpublisher jdepend plot pmd violations warnings xunit
java -jar jenkins-cli.jar -s http://localhost:8080 safe-restart