Fix account-gh plugin info step writing to wrong path
The account-gh job builds into bazel-bin/plugins/account (its build
script hardcodes "account"), but the shared get-project-info step keyed
its output on the JJB project name {name}, which is "account-gh". So it
fetched plugins/account-gh config from googlesource (404) and tried to
write bazel-bin/plugins/account-gh/account-gh.json into a directory that
never exists, failing the build under "bash -e".
This regressed in c0e955e: adding the stable-3.12 googlesource build
needed a second project block, and JJB project names must be unique, so
the gerrithub block was renamed account -> account-gh. That flipped
{name} while the build script kept using "account". Before that, {name}
was "account" and the info step worked (e.g. build #14).
Parametrize gerrit-bazel-get-project-info.sh with project-info-host,
project-info-name and project-info-output (the nested defaults mirror the
existing targets default):
* plugin-template-bazel and plugin-gitblit keep the previous
gerrit-review.googlesource.com / {class}%2F{name} / {name} behaviour
* plugin-gh-template defaults to gerrithub review.gerrithub.io /
{organization}%2F{repo} / {repo}, matching its GitHub-hosted jobs
* the account-gh job overrides them to fetch GerritForge/account from
gerrithub and write account.json
This reuses the shared helper instead of duplicating the fetch logic.
Change-Id: I694baf0433c33947b30c2a7dd37e03011f02a323
diff --git a/jenkins/gerrit-bazel-get-project-info.sh b/jenkins/gerrit-bazel-get-project-info.sh
index 0d73696..03db840 100755
--- a/jenkins/gerrit-bazel-get-project-info.sh
+++ b/jenkins/gerrit-bazel-get-project-info.sh
@@ -1,5 +1,5 @@
#!/bin/bash -e
-curl -L https://gerrit-review.googlesource.com/projects/{class}%2F{name}/config | \
- tail -n +2 > bazel-bin/plugins/{name}/{name}.json
+curl -L https://{project-info-host}/projects/{project-info-name}/config | \
+ tail -n +2 > bazel-bin/plugins/{project-info-output}/{project-info-output}.json
diff --git a/jenkins/gerrit-bazel-plugin-account.yaml b/jenkins/gerrit-bazel-plugin-account.yaml
index 1f6c54f..1bd2371 100644
--- a/jenkins/gerrit-bazel-plugin-account.yaml
+++ b/jenkins/gerrit-bazel-plugin-account.yaml
@@ -6,6 +6,9 @@
node: bazel-debian
class: plugins
project-name: plugins%2Faccount
+ project-info-host: review.gerrithub.io
+ project-info-name: GerritForge%2Faccount
+ project-info-output: account
scm:
- git:
remotes:
diff --git a/jenkins/gerrit-bazel-plugin-gh-template.yaml b/jenkins/gerrit-bazel-plugin-gh-template.yaml
index 01d2a2e..6d3dd3f 100644
--- a/jenkins/gerrit-bazel-plugin-gh-template.yaml
+++ b/jenkins/gerrit-bazel-plugin-gh-template.yaml
@@ -1,6 +1,9 @@
- defaults:
name: plugin-gh-template
targets: 'plugins/{name}:{name}'
+ project-info-host: review.gerrithub.io
+ project-info-name: '{organization}%2F{repo}'
+ project-info-output: '{repo}'
node: bazel-debian
wrappers:
- timeout:
diff --git a/jenkins/gerrit-bazel-plugin-gitblit.yaml b/jenkins/gerrit-bazel-plugin-gitblit.yaml
index e16ca56..6ffc0ea 100644
--- a/jenkins/gerrit-bazel-plugin-gitblit.yaml
+++ b/jenkins/gerrit-bazel-plugin-gitblit.yaml
@@ -1,5 +1,8 @@
- defaults:
name: 'plugin-gitblit'
+ project-info-host: gerrit-review.googlesource.com
+ project-info-name: '{class}%2F{name}'
+ project-info-output: '{name}'
wrappers:
- timeout:
timeout: 30
diff --git a/jenkins/gerrit-bazel-plugin-template.yaml b/jenkins/gerrit-bazel-plugin-template.yaml
index 3a4f23b..62c131b 100644
--- a/jenkins/gerrit-bazel-plugin-template.yaml
+++ b/jenkins/gerrit-bazel-plugin-template.yaml
@@ -1,6 +1,9 @@
- defaults:
name: plugin-template-bazel
targets: 'plugins/{name}:{name}'
+ project-info-host: gerrit-review.googlesource.com
+ project-info-name: '{class}%2F{name}'
+ project-info-output: '{name}'
node: bazel-debian
wrappers:
- timeout: