-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitlab_rpm_start.sh
70 lines (65 loc) · 2.11 KB
/
gitlab_rpm_start.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
## gitlab_rpm 2016-05-16
## http://www.aqzt.com
##email: [email protected]
##robert yu
##centos 6和centos 7
OS_CENTOS6(){
yum install -y curl openssh-server openssh-clients postfix cronie git nmap unzip wget lsof xz gcc make vim curl
service postfix start
chkconfig postfix on
lokkit -s http -s ssh
curl -LJO https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-8.7.5-ce.0.el6.x86_64.rpm
rpm -i gitlab-ce-8.7.5-ce.0.el6.x86_64.rpm
curl -LJO https://mirror.tuna.tsinghua.edu.cn/gitlab-ci-multi-runner/yum/el6/gitlab-ci-multi-runner-1.1.4-1.x86_64.rpm
rpm -i gitlab-ci-multi-runner-1.1.4-1.x86_64.rpm
gitlab-ctl reconfigure
gitlab-runner restart
gitlab-ctl restart
}
OS_CENTOS7(){
yum install -y gcc make gcc-c++ automake lrzsz openssl-devel zlib-* bzip2-* readline* zlib-* bzip2-* git nmap unzip wget lsof xz net-tools vim curl policycoreutils openssh-server openssh-clients postfix
systemctl enable sshd
systemctl start sshd
systemctl enable postfix
systemctl start postfix
curl -LJO https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-8.7.5-ce.0.el7.x86_64.rpm
rpm -i gitlab-ce-8.7.5-ce.0.el7.x86_64.rpm
curl -LJO https://mirror.tuna.tsinghua.edu.cn/gitlab-ci-multi-runner/yum/el7/gitlab-ci-multi-runner-1.1.4-1.x86_64.rpm
rpm -i gitlab-ci-multi-runner-1.1.4-1.x86_64.rpm
gitlab-ctl reconfigure
gitlab-runner restart
gitlab-ctl restart
}
OS_SYSTEM(){
if [ -f /etc/redhat-release ];then
## OS=CentOS
if [ ! -z "`cat /etc/redhat-release | grep CentOS |grep "release 7"`" ];then
OS=CentOS7
elif [ ! -z "`cat /etc/redhat-release | grep CentOS |grep "release 6"`" ];then
OS=CentOS6
else
echo $OS
fi
elif [ ! -z "`cat /etc/issue | grep bian`" ];then
OS=Debian
elif [ ! -z "`cat /etc/issue | grep Ubuntu`" ];then
OS=Ubuntu
else
echo -e "\033[31mDoes not support this OS, Please contact the author! \033[0m"
fi
echo $OS
}
OS_command()
{
if [ $OS == 'CentOS6' ];then
OS_CENTOS6
elif [ $OS == 'CentOS7' ];then
OS_CENTOS7
else
echo -e "\033[31mDoes not support this OS, Please contact the author! \033[0m"
fi
}
OS_SYSTEM
OS_command
echo ok