Update lf-maven-stage macro with missing parts 93/14393/9
authorBengt Thuree <bthuree@linuxfoundation.org>
Thu, 31 Jan 2019 00:14:03 +0000 (11:14 +1100)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Sun, 10 Feb 2019 17:19:31 +0000 (12:19 -0500)
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 <bthuree@linuxfoundation.org>
jjb/lf-macros.yaml
jjb/lf-maven-jobs.yaml
releasenotes/notes/refactor-5d0c339718d7aaca.yaml [new file with mode: 0644]

index 08bb637..2b6cf10 100644 (file)
           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
index 9c8b953..f20dbe9 100644 (file)
 - 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
       - 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 (file)
index 0000000..2306484
--- /dev/null
@@ -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'