IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    Gitlab 日常维护

    lytsing发表于 2014-12-24 16:04:50
    love 0

    安装完gitlab只是第一步,后期维护还需要费力。

    文件约定

    VERSION 文件

    每个项目要增加这个文件,里面写着版本号, 效果见 https://gitlab.com/gitlab-org/gitlab-ce 右则导航栏,方便查看当前版本号。

    .gitignore

    避免提交一堆垃圾文件,及时加上.gitignore文件,有在线工具生成 https://www.gitignore.io/

    版本升级

    参考官方提供的文档 https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/upgrader.md 操作,一般不会遇到遇到很大的问题。如果本地修改一些文件,自动升级的脚本会执行git stash存档,同步完后,需要手动 git stash pop

    但不会是一劳永逸,lib 目录下一些配置更新了,还需要对照版本升级说明 https://github.com/gitlabhq/gitlabhq/tree/master/doc/update 手动修改 。

    以上的方式,比较适合不需要对gitlab大修改,如果定制自己的UI或页面,最好建立自己的分支:

    su - git
    cd /home/git/gitlab/
    git checkout -b my_branch
    1. Stop gitlab service
    2. Run git fetch –all
    3. Run git branch 7-5-stable origin/7-5-stable (replace with appropriate version)
    4. Run git rebase 7-5-stable my_branch
    5. Follow the rest of instructions (db:migrate, assets:precompile, etc.)

    参考: http://axilleas.me/en/blog/2014/custom-gitlab-login-page/

    代码备份

    已经有人写了一个脚本脚本,见 https://github.com/sund/auto-gitlab-backup 定期把备份数据拷贝到备机,避免硬盘挂掉的悲剧,更保险一点,需要每月拷贝到移动硬盘上存档。

    性能优化

    Nginx

    根据CPU,work数跟CPU数一样。



沪ICP备19023445号-2号
友情链接