zoukankan      html  css  js  c++  java
  • 在Gerrit中修改project.config

    reference:https://blog.bruin.sg/2013/04/19/how-to-edit-the-project-config-for-all-projects-in-gerrit/

    背景

    有时候需要重新配置Gerrit;如果将所有的项目都重新手动配一遍,是比较麻烦的。在网上找到了配置方法。

    思路:由于项目设置保存在项目的Git存储库中,因此可以通过gerrit附带的ssh操作,在从Gerrit克隆项目、进行更改,再commit以及push到Gerrit来实现修改。

    PROJECT=你需要修改权限的项目名,如果希望所有项目都可以生效,则修改`All-Projects`。
    
    $ mkdir gerrit_config # 目录无所谓
    $ cd gerrit_config
    
    $ git init
    
    $ git remote add origin ssh://<USER>@<GERRITHOST>:29418/<PROJECT>
    
    $ git fetch origin refs/meta/config:refs/remotes/origin/meta/config
    remote: Counting objects: 7, done
    remote: Finding sources: 100% (7/7)
    remote: Total 7 (delta 0), reused 0 (delta 0)
    Unpacking objects: 100% (7/7), done.
    From ssh://10.88.105.12:29418/All-Projects
     * [new ref]         refs/meta/config -> origin/meta/config
    git checkout meta/config
    

    此后,可以看到两个文件,一个跟组名有关,一个与当前项目的配置有关:

    通常,在http://<GERRITHOST>:<PORT>:8080/plugins/gitiles/中可以看到有关的改动。

    $ ls
    groups  project.config
    

    最后,将其提交即可(确保有项目对应的访问权限)。

    git commit -a
    git push origin meta/config:meta/config
    

    此后,可以看到对应的提交:

    http://<GERRITHOST>:<PORT>:8080/plugins/gitiles/

        9123049 test by schips · 21 seconds ago
        b3fec78 Configure 'Verified' label by Gerrit Code Review · 5 days ago
        b42a8c3 Initialized Gerrit Code Review 3.1.4 by Gerrit Code Review · 5 days ago
    
  • 相关阅读:
    又过了一周
    本周学习情况
    5.12
    一周回顾
    npm修改全局包安装路径
    热力图之heatmap
    前端的发展历程
    idea打开maven项目没有别识别是maven项目
    nginx下部署vue项目
    WEB前端开发NodeJS
  • 原文地址:https://www.cnblogs.com/schips/p/how_to_edit_the_project-config_for_projects_in_gerrit.html
Copyright © 2011-2022 走看看