From 995fbe45bfdfcb86cf91ef433f63848139d5c4b1 Mon Sep 17 00:00:00 2001 From: Ravi Pendurty Date: Tue, 22 Jul 2025 17:43:32 +0530 Subject: [PATCH] Add gerrit-merge.yaml gerrit-merge to be triggered on submit Issue-ID: OAM-479 Change-Id: Ie0213d52af0120015de8dda94dbc45d6ff90a194 Signed-off-by: Ravi Pendurty --- .github/workflows/gerrit-merge.yaml | 87 ++++++++++++++++++++++++++++++++++++ .github/workflows/gerrit-verify.yaml | 1 + Makefile | 10 ++++- 3 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/gerrit-merge.yaml diff --git a/.github/workflows/gerrit-merge.yaml b/.github/workflows/gerrit-merge.yaml new file mode 100644 index 0000000..3ee2c1d --- /dev/null +++ b/.github/workflows/gerrit-merge.yaml @@ -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 diff --git a/.github/workflows/gerrit-verify.yaml b/.github/workflows/gerrit-verify.yaml index 6a0633e..03dccb6 100644 --- a/.github/workflows/gerrit-verify.yaml +++ b/.github/workflows/gerrit-verify.yaml @@ -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) }} diff --git a/Makefile b/Makefile index 4db708b..a47891a 100644 --- 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 + -- 2.16.6