-
Notifications
You must be signed in to change notification settings - Fork 41
/
build.sh
37 lines (32 loc) · 1.12 KB
/
build.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
#!/bin/sh
yum -y update
# install docker
yum -y install yum-utils device-mapper-persistent-data lvm2 epel-release
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum -y install docker-ce
systemctl start docker
systemctl enable docker
# install git
yum -y install git
# install jenkins
yum -y install java-1.8.0-openjdk.x86_64 wget
cp /etc/profile /etc/profile_backup
echo 'export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk' | sudo tee -a /etc/profile
echo 'export JRE_HOME=/usr/lib/jvm/jre' | sudo tee -a /etc/profilesource /etc/profile
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat/jenkins.repo
rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key
yum -y install jenkins
systemctl start jenkins.service
systemctl enable jenkins.service
usermod -a -G docker jenkins
systemctl start firewalld
systemctl enable firewalld
firewall-cmd --zone=public --permanent --add-port=8080/tcp
firewall-cmd --reload
# install aws cli
yum -y install python-pip
pip install --upgrade pip
pip install awscli --upgrade --user
echo "PATH=~/.local/bin:$PATH" >> ~/.bash_profile
# reboot
systemctl reboot