gitlab

#!/bin/bash
kk=`ip a|grep ens|grep inet|awk -F ' ' '{print $2}'|awk -F '/' '{print $1}'`
echo "[gitlab-ce]" >> /etc/yum.repos.d/gitlab-ce.repo
echo "name=Gitlab CE Repository" >> /etc/yum.repos.d/gitlab-ce.repo
echo "baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el\$releasever/" >> /etc/yum.repos.d/gitlab-ce.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/gitlab-ce.repo
echo "enabled=1" >> /etc/yum.repos.d/gitlab-ce.repo
yum makecache
yum -y install gitlab-ce
sed -i "/external_url 'http\:\/\/gitlab.example.com'/a\external_url 'http\:\/\/$kk'" /etc/gitlab/gitlab.rb
sed "/\# unicorn\['port'\] = 8080/a\unicorn\['port'\] = 9999" /etc/gitlab/gitlab.rb //修改端口,不然很可能网页出现505的错误
gitlab-ctl reconfigure
gitlab-ctl restart

posted @ 2018-08-28 19:17  e-8bit  阅读(171)  评论(0编辑  收藏  举报