同步操作将从 user_76863/centos-script 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash#获取本机ip地址IP_ADDRESS=$(ip a | grep inet | grep -v inet6 | grep -v 127 | sed 's/^[ \t]*//g' | cut -d ' ' -f2 | grep -v 172 | cut -d '/' -f1 | head -1)echo -e '033円[1;32m 安装GitLab 033円[0m'echo -e '033円[1;32m 1.安装SSH 033円[0m'yum -y install curl policycoreutils openssh-server openssh-clients policycoreutils-pythonecho -e '033円[1;32m 设置SSH开机自启动 033円[0m'systemctl enable sshdecho -e '033円[1;32m 启动SSH服务 033円[0m'systemctl start sshdecho -e '033円[1;32m 2.安装邮件系统用来发送邮件 033円[0m'yum -y install postfixsystemctl enable postfixsystemctl start postfixecho -e '033円[1;32m 安装GitLab社区版 033円[0m'wget -c https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.4.6-ce.0.el7.x86_64.rpmrpm -i gitlab-ce-11.4.6-ce.0.el7.x86_64.rpmecho -e '033円[1;32m 添加定时任务,每天凌晨两点,执行gitlab备份 033円[0m'sed -i '$a0円 2 * * * root /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1' /etc/crontabecho -e '033円[1;32m 加载任务,使之生效 033円[0m'crontab /etc/crontabecho -e '033円[1;32m 查看任务 033円[0m'crontab -lecho -e '033円[1;32m 自动编辑gitlab配置文件,设置域名和文件保存时间,默认保存7天 033円[0m'sed -i "s/external_url 'http:\/\/gitlab.example.com'/external_url 'http:\/\/${IP_ADDRESS}'/g" /etc/gitlab/gitlab.rbsed -i "s/# gitlab_rails\['backup_keep_time'\] = 604800/gitlab_rails\['backup_keep_time'\] = 604800/g" /etc/gitlab/gitlab.rbecho -e '033円[1;32m 更新配置并重启 033円[0m'gitlab-ctl reconfigureecho -e '033円[1;32m 查看gitlab服务启动状态 033円[0m'gitlab-ctl statusecho -e '033円[1;32m 使用以下指令启动|停止|查看状态|重启服务管理gitlab 033円[0m'echo -e '033円[1;33m gitlab-ctl start|stop|status|restart 033円[0m'echo -e '033円[1;32m GitLab配置完成!033円[0m'echo -e "0円33[1;32m 清除yum安装包 0円33[0m"yum -y clean allexit
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。