Skip to content

Commit f97125f

Browse files
authored
Create install_jenkins.sh
1 parent a0103e8 commit f97125f

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

install_jenkins.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/sh
2+
3+
#Install Java
4+
sudo apt-get update
5+
sudo apt install openjdk-8-jdk -y
6+
sudo chmod o+w /etc/environment
7+
echo JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64" >> /etc/environment
8+
sudo chmod o-w /etc/environment
9+
sudo source /etc/environment
10+
echo $JAVA_HOME
11+
12+
#Install maven
13+
sudo apt-get update -y
14+
sudo apt-get upgrade -y
15+
cd /opt/
16+
sudo wget https://www-eu.apache.org/dist/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz
17+
sudo tar -xvzf apache-maven-3.6.1-bin.tar.gz
18+
sudo mv apache-maven-3.6.1 maven
19+
sudo rm apache-maven-3.6.1-bin.tar.gz
20+
sudo touch /etc/profile.d/mavenenv.sh
21+
sudo chmod o+w /etc/profile.d/mavenenv.sh
22+
echo export M2_HOME=/opt/maven export PATH=${M2_HOME}/bin:${PATH} > /etc/profile.d/mavenenv.sh
23+
sudo chmod ugo+x,o-w /etc/profile.d/mavenenv.sh
24+
source /etc/profile.d/mavenenv.sh
25+
sudo apt install maven -y
26+
mvn --version
27+
28+
29+
#Install jenkins
30+
sudo wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
31+
echo deb https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list
32+
sudo apt-get update
33+
sudo apt-get install jenkins -y
34+
sudo systemctl start jenkins
35+
sudo systemctl status jenkins
36+
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
37+
38+
#Install Docker Engine
39+
sudo apt-get update -y
40+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
41+
sudo apt-key fingerprint 0EBFCD88
42+
sudo add-apt-repository \
43+
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
44+
$(lsb_release -cs) \
45+
stable"
46+
sudo apt-get update -y
47+
sudo apt-get install docker-ce -y
48+
sudo docker --version
49+
50+
#Install Docker-Compose
51+
curl -L https://github.com/docker/compose/releases/download/1.24.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
52+
cd /usr/local/bin
53+
sudo chmod +x /usr/local/bin/docker-compose
54+
docker-compose --version

0 commit comments

Comments
 (0)