docker - 在 docker 容器中安装 gerrit 插件
问题描述
运行gerritcodereview/gerrit
docker 容器时。Gerrit 安装在/var/gerrit
容器的目录中。但是当尝试通过从https://gerrit-ci.gerritforge.com/job/plugin-its-jira-bazel-stable-2.16/docker cp
下载的插件 .jar 文件安装插件到目录中时,插件没有显示在已安装插件的列表中。即使我重新启动了容器。/var/gerrit/plugins
我用 gerrit 运行:
docker run -ti -p 8080:8080 -p 29418:29418 gerritcodereview/gerrit
Gerrit 可通过以下方式访问: http://localhost:8080/admin/plugins
我在插件管理器中也有一个插件列表,但不知道如何将更多插件添加到列表中,曾尝试在 [httpd] 中使用 gerrit-ci.gerritforge.com url。http://localhost:8080/plugins/plugin-manager/static/index.html
我的gerrit.config
文件如下所示:
[gerrit]
basePath = git
serverId = 62b710a2-3947-4e96-a196-6b3fb1f6bc2c
canonicalWebUrl = http://10033a3fe5b7
[database]
type = h2
database = db/ReviewDB
[index]
type = LUCENE
[auth]
type = DEVELOPMENT_BECOME_ANY_ACCOUNT
[sendemail]
smtpServer = localhost
[sshd]
listenAddress = *:29418
[httpd]
listenUrl = http://*:8080/
filterClass = com.googlesource.gerrit.plugins.ootb.FirstTimeRedirect
firstTimeRedirectUrl = /login/%23%2F?account_id=1000000
[cache]
directory = cache
[plugins]
allowRemoteAdmin = true
[container]
javaOptions = "-Dflogger.backend_factory=com.google.common.flogger.backend.log4j.Log4jBackendFactory#getInstance"
javaOptions = "-Dflogger.logging_context=com.google.gerrit.server.logging.LoggingContext#getInstance"
user = gerrit
javaHome = /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/jre
javaOptions = -Djava.security.egd=file:/dev/./urandom
[receive]
enableSignedPush = false
[noteDb "changes"]
autoMigrate = true
解决方案
终于在我的用例中找到了一种适合我的方法。
- 复制您的公钥内容并插入 ssh Web 浏览器配置文件设置:my_gerrit_admin_username
- 将密钥添加到 ssh-agent:
eval `ssh-agent`
ssh-add .ssh/id_rsa
- 从容器外的终端运行:
ssh -p 29418 my_gerrit_admin_username@localhost gerrit plugin install -n its-base.jar https://gerrit-ci.gerritforge.com/job/plugin-its-base-bazel-stable-2.16/lastSuccessfulBuild/artifact/bazel-bin/plugins/its-base/its-base.jar
- 检查网络浏览器插件中是否安装了插件。
推荐阅读
- flutter - Flutter 中的 fontSize 和 textScaleFactor 有什么区别?
- c# - 将代码从 C# windows 窗体更改为类
- java - 使用 JUnit 调用 Activity 构造函数没有引发运行时异常?
- c# - 递归遍历对象的属性会引发 StackOverflowException
- .net - vb.net 创建一个对象的引用
- android - 如何构建自己的自定义 android ROM?
- dart - 颤动中所有设备的填充
- python - 为什么 Python 2 input() 给我'NameError:名称“____”未定义'?
- javascript - 脚本无法在页面加载 JS 上获取元素
- python - 在 Ionic 和 Flask 中发送和保存图像时出错