局域网 centos7 搭建gitlab
1、首先,装一个postgresql 但是不能立即启动它(不要设置开机启动,因为后面gitlab使用的时候会提示已经占用),下载gitlab rpm包,安装之。2、下载好rpm包以后,redis nginx 等都以及在里面了,而不用自己再配置。但postgresql还是要自己装的。
3、sudo yum install openssh-server
sudo yum install postfix
sudo systemctl enable sshd
sudo systemctl start sshd
sudo systemctl enable postfix
sudo systemctl start postfix
sudo gitlab-ctl reconfigure
4、全部配置好了,就可以用gitlab-ctlstatus 来检查配置。正确的配置应该是这样的:
run: nginx: (pid 972) 7s; run: log: (pid 971) 7s
run: postgresql: (pid 962) 7s; run: log: (pid 959) 7s
run: redis: (pid 964) 7s; run: log: (pid 963) 7s
run: sidekiq: (pid 967) 7s; run: log: (pid 966) 7s
run: unicorn: (pid 961) 7s; run: log: (pid 960) 7s
其中任何一个down都可以用sudo gitlab-ctl tail nginx/postgresql 来检查。
5、配置完成之后,登陆 localhost 就看到一个大狐狸 ,初始帐号 :root 密码:5iveL!fe
6、网页配置完成,下面就是git的内容:
1、首先,在你的用户目录下面新建一个文件夹,进入之。 git init 之后那个文件夹就是你的 repostories 了(本地仓库)
2、提交到远程:git add READMD.md
git commit -m "i made README.md file"
git remote origin git@10.120.59.221:git-data/repostories/root/test.git(test是你在网页上新建的project)ps: 这里有点玄乎,一开始要填写很长的路径,后来就可以从 :root/test.git 来了
git push -u origin master (origin 是你要提交到的仓库分支, master 是你本地的仓库分支)
3、从远程仓库克隆: 在本地新建一个文件夹 进入之。
git clone git@10.120.59.221:root/test.git
4、从远程pull下东西(更新) :git pull origin master
页:
[1]