美文网首页
OpenGrok项目管理

OpenGrok项目管理

作者: 戈壁堂 | 来源:发表于2020-09-09 20:14 被阅读0次

    问题:

    将gitlab下的项目按组添加为opengrok的项目,每个组对应为一个opengrok项目。先添加项目最多的几个group,总计项目解决1k。目前为止一起正常。

    A project can have zero or more Source Code Management repositories underneath.

    根据Per project management and workflow文档进行实践。需要安装OpenGrok tools ,将python封装的命令封装到用户目录的 opengroktools文件夹下。

    需要将其他group内容作为新的项目添加到opengrok。

    when indexing newly added project, it is necessary to add it to the configuration first, then index it and lastly make the new configuration persistent.

    • 先做备份,将configuration.xml文件备份
    • 添加项目组234_sale添加到配置文件中。
    $> opengroktools/bin/opengrok-projadm -b opengrok -a 234_sale
    Adding project 234_sale
    Refreshing configuration
    
    • 更新索引。官方动作
    curl -s -X GET http://localhost:8080/source/api/v1/configuration -o fresh_config.xml
    opengrok-indexer -a /opengrok/dist/lib/opengrok.jar -- \
        -c /usr/local/bin/ctags \
        -U 'http://localhost:8080/source' \
        -o /opengrok/etc/ctags.config \
        -R fresh_config.xml
        -H PROJECT_NAME \
        PROJECT_NAME
    

    分两步操作。首先执行curl -s -X GET http://localhost:8080/source/api/v1/configuration -o fresh_config.xml下载最新的配置文件到本地。
    执行建立索引的动作:只针对当前项目。

    各个参数的含义可以执行java -jar opengrok.jar --help获取到详细详细。最后备份一份

    opengroktools/bin/opengrok-indexer -a opengrok/dist/lib/opengrok.jar -- \
        -c /usr/local/bin/ctags \
        -U 'http://localhost:8080/source' \
        -s /data1/data/groups -d opengrok/data0907 \
        -R fresh_config.xml
        -H 234_sale \
        234_sale
    

    指定了 -s 和 -d 参数后,最后的参数时候被忽略了?自动判断了index的缓存历史,最终效果是将234_sale组添加到了配置文件并生效。

    目前无法确定真实的逻辑是怎样的。看来需要去读源码乜?

    opengrok-indexer添加项目时,不需要指定源码、数据目录。这些值在配置文件中已经记录。使用官方的方法即可,效果如下——

    opengroktools/bin/opengrok-indexer -a opengrok/dist/lib/opengrok.jar -- \
    >     -c /usr/local/bin/ctags \
    >     -U 'http://localhost:8080/source' \
    >     -R fresh_config.xml
        -H sub1 \
        sub1 Sep 11, 2020 3:59:44 PM org.opengrok.indexer.configuration.Configuration read
    INFO: Reading configuration from /home/vip/fresh_config.xml
    Sep 11, 2020 3:59:45 PM org.opengrok.indexer.index.Indexer parseOptions
    
    

    -H参数实际是由opengrok.jar包提供的

    删除效果——

    相关文章

      网友评论

          本文标题:OpenGrok项目管理

          本文链接:https://www.haomeiwen.com/subject/jupeektx.html