From: Vratko Polak Date: Tue, 2 Apr 2024 18:37:34 +0000 (+0200) Subject: Fix: Add comment as parameter to deploy job X-Git-Tag: v0.90.4~3^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F76%2F72776%2F7;p=releng%2Fglobal-jjb.git Fix: Add comment as parameter to deploy job While testing deploy jobs on Sandbox is not impossible, currently it needs manual editing of job configuration. With this, the comment text can be added when starting job manually in Sandbox. Issue: RELENG-5184 Change-Id: I38528702b6da3dd359d058521ee39469b17f4265 Signed-off-by: Vratko Polak --- diff --git a/docs/jjb/lf-macros.rst b/docs/jjb/lf-macros.rst index 112fd2f2..c4bda39c 100644 --- a/docs/jjb/lf-macros.rst +++ b/docs/jjb/lf-macros.rst @@ -407,6 +407,14 @@ lf-cmake-parameters Provides parameters required by CMake. Use in any jobs that need to call the ``cmake && make && make install`` pattern. +lf-gerrit-event-comment-text-parameter +-------------------------------------- + +Provides the value for GERRIT_EVENT_COMMENT_TEXT, +needed for jobs triggerable via a gerrit comment +when starting them via "Build with parameters" instead. +For example when testing jobs on Sandbox. + lf-infra-maven-parameters ------------------------- diff --git a/jjb/lf-ci-jobs.yaml b/jjb/lf-ci-jobs.yaml index cd95e701..ac5d424d 100644 --- a/jjb/lf-ci-jobs.yaml +++ b/jjb/lf-ci-jobs.yaml @@ -628,6 +628,8 @@ - lf-infra-jjb-parameters: jjb-cache: "{jjb-cache}" jjb-version: "{jjb-version}" + - lf-gerrit-event-comment-text-parameter: + comment-text: "$GERRIT_EVENT_COMMENT_TEXT" wrappers: - lf-infra-wrappers: diff --git a/jjb/lf-macros.yaml b/jjb/lf-macros.yaml index 4032c5f4..964abf51 100644 --- a/jjb/lf-macros.yaml +++ b/jjb/lf-macros.yaml @@ -473,6 +473,19 @@ default: "{make-opts}" description: "Options to pass to make. Example: -j8" +- parameter: + name: lf-gerrit-event-comment-text-parameter + # GERRIT_EVENT_COMMENT_TEXT parameter is usually provided + # by the triggering gerrit comment. + # Having it as parameter is useful for "Build with parameters", + # for example when testing (otherwise gerrit comment triggered) + # jobs on Sandbox. + parameters: + - string: + name: GERRIT_EVENT_COMMENT_TEXT + default: "{comment-text}" + description: "Simulated gerrit comment when triggering manually." + - parameter: name: lf-infra-maven-parameters parameters: