Add gerrit-merge.yaml 32/14732/1
authorRavi Pendurty <ravi.pendurty@highstreet-technologies.com>
Tue, 22 Jul 2025 12:13:32 +0000 (17:43 +0530)
committerRavi Pendurty <ravi.pendurty@highstreet-technologies.com>
Tue, 22 Jul 2025 12:13:32 +0000 (17:43 +0530)
gerrit-merge to be triggered on submit

Issue-ID: OAM-479
Change-Id: Ie0213d52af0120015de8dda94dbc45d6ff90a194
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
.github/workflows/gerrit-merge.yaml [new file with mode: 0644]
.github/workflows/gerrit-verify.yaml
Makefile

diff --git a/.github/workflows/gerrit-merge.yaml b/.github/workflows/gerrit-merge.yaml
new file mode 100644 (file)
index 0000000..3ee2c1d
--- /dev/null
@@ -0,0 +1,87 @@
+---
+# SPDX-License-Identifier: Apache-2.0
+# SPDX-FileCopyrightText: 2024 The Linux Foundation
+
+name: Gerrit Composed Maven Merge
+
+# yamllint disable-line rule:truthy
+on:
+  workflow_dispatch:
+    inputs:
+      GERRIT_BRANCH:
+        description: "Branch that change is against"
+        required: true
+        type: string
+      GERRIT_CHANGE_ID:
+        description: "The ID for the change"
+        required: true
+        type: string
+      GERRIT_CHANGE_NUMBER:
+        description: "The Gerrit number"
+        required: true
+        type: string
+      GERRIT_CHANGE_URL:
+        description: "URL to the change"
+        required: true
+        type: string
+      GERRIT_EVENT_TYPE:
+        description: "Type of Gerrit event"
+        required: true
+        type: string
+      GERRIT_PATCHSET_NUMBER:
+        description: "The patch number for the change"
+        required: true
+        type: string
+      GERRIT_PATCHSET_REVISION:
+        description: "The revision sha"
+        required: true
+        type: string
+      GERRIT_PROJECT:
+        description: "Project in Gerrit"
+        required: true
+        type: string
+      GERRIT_REFSPEC:
+        description: "Gerrit refspec of change"
+        required: true
+        type: string
+
+concurrency:
+  # yamllint disable-line rule:line-length
+  group: compose-make-merge-${{ github.workflow }}-${{ github.event.inputs.GERRIT_CHANGE_ID || github.run_id }}
+  cancel-in-progress: true
+
+jobs:
+  sanitize:
+    runs-on: ubuntu-latest
+    outputs:
+      sanitized_project: ${{ steps.sanitize.outputs.result }}
+    steps:
+      - name: Sanitize GERRIT_PROJECT
+        id: sanitize
+        run: echo "result=${GERRIT_PROJECT//\//-}" >> $GITHUB_OUTPUT
+        env:
+          GERRIT_PROJECT: ${{ inputs.GERRIT_PROJECT }}
+
+  maven-merge:
+    needs: [sanitize]
+    # use compose-jjb-verify from the v0.4 series of releng-reusable-workflows
+    # yamllint disable-line rule:line-length
+    uses: ravipendurty/releng-reusable-workflows/.github/workflows/compose-make-merge.yaml@main
+    with:
+      GERRIT_BRANCH: ${{ inputs.GERRIT_BRANCH }}
+      GERRIT_CHANGE_ID: ${{ inputs.GERRIT_CHANGE_ID }}
+      GERRIT_CHANGE_NUMBER: ${{ inputs.GERRIT_CHANGE_NUMBER }}
+      GERRIT_CHANGE_URL: ${{ inputs.GERRIT_CHANGE_URL }}
+      GERRIT_EVENT_TYPE: ${{ inputs.GERRIT_EVENT_TYPE }}
+      GERRIT_PATCHSET_NUMBER: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
+      GERRIT_PATCHSET_REVISION: ${{ inputs.GERRIT_PATCHSET_REVISION }}
+      GERRIT_PROJECT: ${{ github.repository_owner }}/${{ needs.sanitize.outputs.sanitized_project }}
+      GERRIT_REFSPEC: ${{ inputs.GERRIT_REFSPEC }}
+      JDK_VERSION: "21"
+      MVN_VERSION: "3.9.6"
+      MAKE_TARGETS: "deploy"
+      PUSH_NEXUS: true
+      # yamllint enable rule:line-length
+      ENV_VARS: ${{ toJSON(vars) }}
+
+  
\ No newline at end of file
index 6a0633e..03dccb6 100644 (file)
@@ -97,6 +97,7 @@ jobs:
       GERRIT_REFSPEC: ${{ inputs.GERRIT_REFSPEC }}
       JDK_VERSION: "21"
       MVN_VERSION: "3.9.6"
+      MAKE_TARGETS: "build"
       # yamllint enable rule:line-length
       ENV_VARS: ${{ toJSON(vars) }}
 
index 4db708b..a47891a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -38,5 +38,13 @@ dist:
        mvn clean install -f distribution/oam-controller/pom.xml -s settings.xml
        mvn clean install -f distribution/oam-controller-web/pom.xml -s settings.xml
 
+## deploy                              Deploy artifacts to some artifact repository like nexus, jfrog, github packages etc.
+deploy:
+       mvn clean deploy -f parents/pom.xml -s settings.xml
+       mvn clean deploy -f features/sdnr/wt/pom.xml -s settings.xml
+       mvn clean deploy -f features/sdnr/odlux/pom.xml -s settings.xml
+       mvn clean deploy -f distribution/oam-controller/pom.xml -s settings.xml
+
 ## all:                 Build features and images
-all: parents features-wt features-odlux dist
+build: parents features-wt features-odlux dist
+