感谢支持
我们一直在努力

升级GitLab6.x – 1

前一篇文章《在 Ubuntu 12.04 上安装 GitLab6.x》 http://www.linuxidc.com/Linux/2013-08/89292.htm 已经介绍了安装Gitlab6.2的过程,那么怎么升级他呢?

GitLab 的详细介绍:请点这里
GitLab 的下载地址:请点这里

1. 备份

cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production

2. 停止gitlab服务

sudo service gitlab stop

3. 获取最新的发行版本

cd /home/git/gitlab
sudo -u git -H git fetch

删除原来的application.rb文件

sudo -u git rm -rf config/application.rb

检出新版本

sudo -u git -H git checkout 6-3-stable

4. 升级gitlab-shell

cd /home/git/gitlab-shell
sudo -u git -H git fetch
sudo -u git -H git checkout v1.8.0

5. 安装库并迁移他

以MySQL为例

cd /home/git/gitlab
sudo -u git -H bundle install –without development test postgres –deployment

迁移数据库

sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production

清除缓冲

sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production

6. 升级配置文件

cd /home/git/gitlab
sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb

7. 升级启动脚本

sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
sudo chmod +x /etc/init.d/gitlab

8. 重启

sudo service gitlab start
sudo service nginx restart

附:

 

检查Gitlab环境信息

 

检查Gitlab情况

相关阅读

在 Ubuntu 12.04 上安装 GitLab http://www.linuxidc.com/Linux/2012-12/75249.htm

GitLab 5.3 升级注意事项 http://www.linuxidc.com/Linux/2013-06/86473.htm

在 CentOS 上部署 GitLab (自托管的Git项目仓库) http://www.linuxidc.com/Linux/2013-06/85754.htm

终端执行情况:

tdtc010@tdtc010-Vostro-270:~$ cd /home/git/gitlab
tdtc010@tdtc010-Vostro-270:/home/git/gitlab$ sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production

System information
System:        Ubuntu 12.04
Current User:  git
Using RVM:      no
Ruby Version:  2.0.0p247
Gem Version:    2.0.3
Bundler Version:1.3.5
Rake Version:  10.1.0

GitLab information
Version:        6.3.1
Revision:      779b4dc
Directory:      /home/git/gitlab
DB Adapter:    mysql2
URL:            http://localhost
HTTP Clone URL: http://localhost/some-project.git
SSH Clone URL:  git@localhost:some-project.git
Using LDAP:    no
Using Omniauth: no

GitLab Shell
Version:        1.8.0
Repositories:  /home/git/repositories/
Hooks:          /home/git/gitlab-shell/hooks/
Git:            /usr/bin/git
tdtc010@tdtc010-Vostro-270:/home/git/gitlab$ sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
Checking Environment …

Git configured for git user? … yes
Has Python2? … yes
python2 is supported version? … yes

Checking Environment … Finished

Checking GitLab Shell …

GitLab Shell version >= 1.7.9 ? … OK (1.8.0)
Repo base directory exists? … yes
Repo base directory is a symlink? … no
Repo base owned by git:git? … yes
Repo base access is drwxrws—? … yes
update hook up-to-date? … yes
update hooks in repos are links: …
xiao bin / companySite … ok
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
        /home/git/repositories: OK
        /home/git/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.2.12
Send ping to redis server: PONG
gitlab-shell self-check successful

Checking GitLab Shell … Finished

Checking Sidekiq …

Running? … yes
Number of Sidekiq processes … 1

Checking Sidekiq … Finished

Checking GitLab …

Database config exists? … yes
Database is SQLite … no
All migrations up? … yes
GitLab config exists? … yes
GitLab config outdated? … no
Log directory writable? … yes
Tmp directory writable? … yes
Init script exists? … yes
Init script up-to-date? … yes
projects have namespace: …
xiao bin / companySite … yes
Projects have satellites? …
xiao bin / companySite … yes
Redis version >= 2.0.0? … yes
Your git bin path is “/usr/bin/git”
Git version >= 1.7.10 ? … yes (1.8.5)

Checking GitLab … Finished

赞(0) 打赏
转载请注明出处:服务器评测 » 升级GitLab6.x – 1
分享到: 更多 (0)

听说打赏我的人,都进福布斯排行榜啦!

支付宝扫一扫打赏

微信扫一扫打赏