fix(vpp): arm drivers merge job for octeon plugin packagecloud push 72/42472/4
authorKishor Dhanawade <[email protected]>
Wed, 12 Mar 2025 09:43:47 +0000 (09:43 +0000)
committerKishor Dhanawade <[email protected]>
Thu, 27 Mar 2025 05:28:02 +0000 (05:28 +0000)
This patch introduces a new merge job specifically for the Octeon
plugin build. Whenever Octeon-specific changes are merged into VPP,
this job will be triggered. It will upload verified and reviewed
Octeon deb packages to Packagecloud.

Change-Id: I2e2a7e7a8a9ba6008550a2e51a074ae725060ba4
Signed-off-by: Kishor Dhanawade <[email protected]>
jjb/scripts/vpp/arm-drivers.sh
jjb/vpp/vpp.yaml

index cd0ff5c..2666bbe 100755 (executable)
@@ -18,6 +18,14 @@ echo "---> jjb/scripts/vpp/arm-drivers.sh"
 set -euxo pipefail
 
 line="*************************************************************************"
+# Don't build anything if this is a merge job being run when
+# the git HEAD id is not the same as the Gerrit New Revision id.
+if [[ ${JOB_NAME} == *merge* ]] && [ -n "${GERRIT_NEWREV:-}" ] &&
+       [ "$GERRIT_NEWREV" != "$GIT_COMMIT" ] ; then
+    echo -e "\n$line\nSkipping build. A newer patch has been merged.\n$line\n"
+    exit 0
+fi
+
 OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
 OS_VERSION_ID=$(grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
 OS_ARCH=$(uname -m)
@@ -35,21 +43,27 @@ make_deps() {
         BUILD_ERROR="FAILED 'make install-ext-deps'"
         return
     fi
+    if [ -f extras/scripts/build_static_vppctl.sh ]; then
+        if ! extras/scripts/build_static_vppctl.sh ; then
+            BUILD_ERROR="FAILED 'extras/scripts/build_static_vppctl.sh'"
+            return
+        fi
+    fi
 }
-make_build_release_arm_driver() {
+make_pkg_verify_arm_driver() {
     vpp_platform="$1"
     git clean -fdx || true
-    if ! make UNATTENDED=yes build-release VPP_PLATFORM="$vpp_platform"; then
-        BUILD_ERROR="FAILED 'make build-release VPP_PLATFORM=$vpp_platform'"
+    if ! make UNATTENDED=yes pkg-verify VPP_PLATFORM="$vpp_platform"; then
+        BUILD_ERROR="FAILED 'make pkg-verify VPP_PLATFORM=$vpp_platform'"
         return
     fi
 }
 
 if [ "${DRYRUN,,}" != "true" ] ; then
     make_deps
-    make_build_release_arm_driver cn913x
-    make_build_release_arm_driver octeon9
-    make_build_release_arm_driver octeon10
+    make_pkg_verify_arm_driver cn913x
+    make_pkg_verify_arm_driver octeon9
+    make_pkg_verify_arm_driver octeon10
 fi
 if [ -n "$BUILD_ERROR" ] ; then
     BUILD_RESULT="$BUILD_ERROR"
index af3ae51..c6e8b85 100644 (file)
     name: vpp-arm-drivers
     jobs:
       - 'vpp-verify-arm-drivers-{stream}-{os}-{executor-arch}'
+      - 'vpp-merge-arm-drivers-{stream}-{os}-{executor-arch}'
     project: 'vpp'
     os:
       - 'ubuntu2404'
       - fdio-infra-publish
 # [end] VPP-MERGE JOB TEMPLATE
 
+# VPP-MERGE-ARM-DRIVERS JOB TEMPLATE
+- job-template:
+    name: 'vpp-merge-arm-drivers-{stream}-{os}-{executor-arch}'
+
+    project-type: freestyle
+    node: 'builder-{os}-prod-{executor-arch}'
+    concurrent: true
+
+    properties:
+      - lf-infra-properties:
+          build-days-to-keep: "{build-days-to-keep}"
+
+    # Please keep parameters in alphabetical order
+    parameters:
+      - gerrit-parameter:
+          branch: '{branch}'
+      - os-parameter:
+          os: '{os}'
+      - project-parameter:
+          project: '{project}'
+      - stream-parameter:
+          stream: '{stream}'
+
+    scm:
+      - gerrit-trigger-scm:
+          credentials-id: 'jenkins-gerrit-credentials'
+          refspec: ''
+          choosing-strategy: 'gerrit'
+
+    wrappers:
+      - fdio-infra-wrappers:
+          build-timeout: 120
+
+    triggers:
+      - gerrit-trigger-patch-merged:
+          name: '{project}'
+          branch: '{branch}'
+
+    builders:
+      - config-file-provider:
+          files:
+            - file-id: '.packagecloud'
+              target: '/root/.packagecloud'
+      - config-file-provider:
+          files:
+            - file-id: 'packagecloud_api'
+              target: '/root/packagecloud_api'
+      - shell:
+          !include-raw-escape:
+          - ../scripts/setup_executor_env.sh
+      - shell:
+          !include-raw-escape:
+          - ../scripts/setup_vpp_ubuntu_docker_test.sh
+      - shell:
+          !include-raw-escape:
+          - ../scripts/setup_vpp_ext_deps.sh
+      - shell:
+          !include-raw-escape:
+          - ../scripts/vpp/arm-drivers.sh
+      - shell:
+          !include-raw-escape:
+          - ../scripts/packagecloud_push.sh
+
+    publishers:
+      - fdio-infra-publish
+# [end] VPP-MERGE-ARM-DRIVERS JOB TEMPLATE
+
 # VPP-GCC-VERIFY JOB TEMPLATE
 - job-template:
     name: 'vpp-gcc-verify-{stream}-{os}-{executor-arch}'