From 6a3a8fd3c9430a90f3b8c0c85e7e20b8a318eb8f Mon Sep 17 00:00:00 2001 From: Bengt Thuree Date: Thu, 31 Jan 2019 11:14:03 +1100 Subject: [PATCH] Update lf-maven-stage macro with missing parts Added the following missing parts to the lf-maven-stage macro. * lf-provide-maven-settings * lf-infra-create-netrc * lf-provide-maven-settings-cleanup This improves the macro to be a complete function that does not require preparatory steps to complete it. New Usage: - lf-maven-stage: mvn-global-settings: 'global-settings' mvn-settings: 'settings' mvn-staging-id: 'staging-profile-id' This patch also updates the lf-maven-central macro as necessary to work along side the lf-maven-stage changes. Issue: RELENG-1554 Change-Id: Ie4fbcb52229c74c4216df4d07f077cd691ab6aa6 Signed-off-by: Bengt Thuree --- jjb/lf-macros.yaml | 4 ++++ jjb/lf-maven-jobs.yaml | 17 +++++++++++++---- releasenotes/notes/refactor-5d0c339718d7aaca.yaml | 16 ++++++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/refactor-5d0c339718d7aaca.yaml diff --git a/jjb/lf-macros.yaml b/jjb/lf-macros.yaml index 08bb637c..2b6cf10f 100644 --- a/jjb/lf-macros.yaml +++ b/jjb/lf-macros.yaml @@ -184,11 +184,15 @@ condition-kind: boolean-expression condition-expression: '{mvn-central}' steps: + - lf-provide-maven-settings: + global-settings-file: '{mvn-global-settings}' + settings-file: '{mvn-settings}' - lf-infra-create-netrc: server-id: 'ossrh' - inject: properties-content: 'OSSRH_PROFILE_ID={ossrh-profile-id}' - shell: !include-raw-escape: ../shell/maven-central.sh + - lf-provide-maven-settings-cleanup - builder: name: lf-maven-install diff --git a/jjb/lf-maven-jobs.yaml b/jjb/lf-maven-jobs.yaml index 9c8b953e..f20dbe97 100644 --- a/jjb/lf-maven-jobs.yaml +++ b/jjb/lf-maven-jobs.yaml @@ -24,10 +24,16 @@ - builder: name: lf-maven-stage builders: + - lf-provide-maven-settings: + global-settings-file: '{mvn-global-settings}' + settings-file: '{mvn-settings}' + - lf-infra-create-netrc: + server-id: '{mvn-staging-id}' # include-raw-escape fails due to JJB bug - - shell: !include-raw: + - shell: !include-raw-escape: - ../shell/common-variables.sh - ../shell/maven-stage.sh + - lf-provide-maven-settings-cleanup - builder: name: lf-update-java-alternatives @@ -716,17 +722,20 @@ - lf-provide-maven-settings: global-settings-file: '{mvn-global-settings}' settings-file: '{mvn-settings}' - - lf-infra-create-netrc: - server-id: '{mvn-staging-id}' - shell: !include-raw-escape: ../shell/maven-patch-release.sh - lf-maven-build: mvn-goals: '{mvn-goals}' - lf-sigul-sign-dir: sign-artifacts: '{sign-artifacts}' sign-dir: '$WORKSPACE/m2repo' - - lf-maven-stage + - lf-maven-stage: + mvn-global-settings: '{mvn-global-settings}' + mvn-settings: '{mvn-settings}' + mvn-staging-id: '{mvn-staging-id}' - lf-maven-central: mvn-central: '{mvn-central}' + mvn-global-settings: '{mvn-global-settings}' + mvn-settings: '{mvn-settings}' ossrh-profile-id: '{ossrh-profile-id}' - lf-provide-maven-settings-cleanup diff --git a/releasenotes/notes/refactor-5d0c339718d7aaca.yaml b/releasenotes/notes/refactor-5d0c339718d7aaca.yaml new file mode 100644 index 00000000..2306484c --- /dev/null +++ b/releasenotes/notes/refactor-5d0c339718d7aaca.yaml @@ -0,0 +1,16 @@ +--- +upgrade: + - | + Jobs using the **lf-maven-stage** macro now need to update to the new + usage. Preparation calls to **lf-provide-maven-settings**, + **lf-infra-create-netrc**, and **lf-provide-maven-settings-cleanup** are no + longer necessary to prepare the **lf-maven-stage** macro. + + Usage: + + .. code-block:: yaml + + - lf-maven-stage: + mvn-global-settings: 'global-settings' + mvn-settings: 'settings' + mvn-staging-id: 'staging profile id' -- 2.16.6