From 40874c69cc5fc00dcc73327af2a1a85bcff7d4d9 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Wed, 6 Mar 2019 12:36:29 -0500 Subject: [PATCH] Update sigul macro to support sign mode Sign mode is a parameter to allow the user to choose whether or not to sign artifacts in parallel using gnu-parallel or in serial mode (bash for loop) methods. Cleanup obsolete lftools_activate method. Change-Id: Ib202f93a37e2830e5048c5a766c17d75233c6423 Signed-off-by: Thanh Ha --- docs/jjb/lf-macros.rst | 1 + jjb/lf-macros.yaml | 5 +++-- jjb/lf-maven-jobs.yaml | 2 ++ releasenotes/notes/sign-mode-2e46e7c5e0b93135.yaml | 24 ++++++++++++++++++++++ shell/sigul-sign-dir.sh | 3 +-- 5 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/sign-mode-2e46e7c5e0b93135.yaml diff --git a/docs/jjb/lf-macros.rst b/docs/jjb/lf-macros.rst index 4d2d4f5f..1d7a97b9 100644 --- a/docs/jjb/lf-macros.rst +++ b/docs/jjb/lf-macros.rst @@ -240,6 +240,7 @@ Requires ``SIGUL_BRIDGE_IP`` configured as a global envvar. :Required Parameters: :sign-artifacts: Whether or not to sign artifacts with Sigul. :sign-dir: Directory to sign. + :sign-mode: serial|parallel lf-infra-provide-docker-cleanup ------------------------------- diff --git a/jjb/lf-macros.yaml b/jjb/lf-macros.yaml index 2b6cf10f..6b3faa85 100644 --- a/jjb/lf-macros.yaml +++ b/jjb/lf-macros.yaml @@ -275,9 +275,10 @@ - shell: !include-raw-escape: ../shell/sigul-configuration.sh - shell: !include-raw-escape: ../shell/sigul-install.sh - inject: - properties-content: SIGN_DIR={sign-dir} + properties-content: | + SIGN_DIR={sign-dir} + SIGN_MODE={sign-mode} - shell: !include-raw-escape: - - ../shell/common-variables.sh - ../shell/sigul-sign-dir.sh - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh diff --git a/jjb/lf-maven-jobs.yaml b/jjb/lf-maven-jobs.yaml index f82d6c6a..0c5abf69 100644 --- a/jjb/lf-maven-jobs.yaml +++ b/jjb/lf-maven-jobs.yaml @@ -679,6 +679,7 @@ mvn-version: mvn35 ossrh-profile-id: '' sign-artifacts: false + sign-mode: serial stream: master submodule-recursive: true submodule-timeout: 10 @@ -728,6 +729,7 @@ - lf-sigul-sign-dir: sign-artifacts: '{sign-artifacts}' sign-dir: '$WORKSPACE/m2repo' + sign-mode: '{sign-mode}' - lf-maven-stage: mvn-global-settings: '{mvn-global-settings}' mvn-settings: '{mvn-settings}' diff --git a/releasenotes/notes/sign-mode-2e46e7c5e0b93135.yaml b/releasenotes/notes/sign-mode-2e46e7c5e0b93135.yaml new file mode 100644 index 00000000..5d4fffd9 --- /dev/null +++ b/releasenotes/notes/sign-mode-2e46e7c5e0b93135.yaml @@ -0,0 +1,24 @@ +--- +features: + - | + **lf-sigul-sign-dir** macros now supports a ``sign-mode`` parameter which + allows jobs to choose to sign artifacts using either *parallel* mode + or *serial* mode (default). +upgrade: + - | + **lf-sigul-sign-dir** users need to add a new parameter ``sign-mode`` to + their job-templates setting either *parallel* or *serial* as the value, we + recommend setting serial mode for this setting. + + **{project-name}-maven-stage-{stream}**'s Sigul signer now defaults to + *serial* mode instead of the previous *parallel* behaviour. To change + this back to the previous behaviour pass the "sign-mode" parameter to the + job template: + + .. code-block:: yaml + + - project: + name: parallel-sign + jobs: + - gerrit-maven-stage: + sign-mode: parallel diff --git a/shell/sigul-sign-dir.sh b/shell/sigul-sign-dir.sh index 8bb7beac..2bcf5894 100644 --- a/shell/sigul-sign-dir.sh +++ b/shell/sigul-sign-dir.sh @@ -13,5 +13,4 @@ echo "---> sigul-sign-dir.sh" # Ensure we fail the job if any steps fail. set -e -o pipefail -lftools_activate -lftools sign sigul "${SIGN_DIR}" +lftools sign sigul -m "${SIGN_MODE}" "${SIGN_DIR}" -- 2.16.6