From 1ff8b84dd1a02b66f0d4dfe724a7ea39bb8178b3 Mon Sep 17 00:00:00 2001 From: NirWolfer Date: Sun, 11 Aug 2024 14:20:03 +0300 Subject: [PATCH] [CI] issue: 4007026 Unify pipeline files into one, change harbor url Jenkins job builder (JJB) allows for multiple job definitions in one file, this will make it easier to share common variables such as folder or git url, as well as make it easier to maintain in the future. In the PDC site the harbor url is different and needs to be changed Merge all jjb files into one under proj_jjb.yaml Change registry url in release_matrix to match the PDC harbor url Remove the latest_release link from do_release script, requrest by the dev team Signed-off-by: NirWolfer --- .ci/do_release.sh | 5 - .ci/{ => pipeline}/Jenkinsfile | 0 .ci/{ => pipeline}/matrix_job.yaml | 0 .ci/pipeline/proj_jjb.yaml | 259 +++++++++++++++++++++ .ci/{ => pipeline}/redmine_matrix_job.yaml | 0 .ci/pipeline/release_jjb.yaml | 65 ------ .ci/proj_jjb.yaml | 131 ----------- .ci/redmine_jjb.yaml | 71 ------ 8 files changed, 259 insertions(+), 272 deletions(-) rename .ci/{ => pipeline}/Jenkinsfile (100%) rename .ci/{ => pipeline}/matrix_job.yaml (100%) create mode 100644 .ci/pipeline/proj_jjb.yaml rename .ci/{ => pipeline}/redmine_matrix_job.yaml (100%) delete mode 100644 .ci/pipeline/release_jjb.yaml delete mode 100644 .ci/proj_jjb.yaml delete mode 100644 .ci/redmine_jjb.yaml diff --git a/.ci/do_release.sh b/.ci/do_release.sh index 7c5dd90fd..81937924e 100755 --- a/.ci/do_release.sh +++ b/.ci/do_release.sh @@ -70,12 +70,7 @@ if [ "${do_release}" = true ] ; then sudo -E -u swx-jenkins mkdir -p "$DST_DIR" sudo -E -u swx-jenkins cp -v "${pkg_name}" "$DST_DIR" - - cd "${release_folder}" - sudo -E -u swx-jenkins ln -s "$DST_DIR/${pkg_name}" latest_release - echo "Release found at $DST_DIR" - else echo "do_release is set to false, skipping package release." fi diff --git a/.ci/Jenkinsfile b/.ci/pipeline/Jenkinsfile similarity index 100% rename from .ci/Jenkinsfile rename to .ci/pipeline/Jenkinsfile diff --git a/.ci/matrix_job.yaml b/.ci/pipeline/matrix_job.yaml similarity index 100% rename from .ci/matrix_job.yaml rename to .ci/pipeline/matrix_job.yaml diff --git a/.ci/pipeline/proj_jjb.yaml b/.ci/pipeline/proj_jjb.yaml new file mode 100644 index 000000000..421e70f6f --- /dev/null +++ b/.ci/pipeline/proj_jjb.yaml @@ -0,0 +1,259 @@ +- job-template: + name: "{jjb_proj}" + project-type: pipeline + folder: "{jjb_folder}" + properties: + - github: + url: "https://github.com/Mellanox/libvma" + - build-discarder: + days-to-keep: 50 + num-to-keep: 20 + - inject: + keep-system-variables: true + properties-content: | + jjb_proj={jjb_proj} + description: Do NOT edit this job through the Web GUI ! + concurrent: false + parameters: + - string: + name: "sha1" + default: "{jjb_branch}" + description: "Commit to be checked, set by PR" + - bool: + name: "build_dockers" + default: false + description: "Rebuild docker containers. Check this box if .ci/DockerFile* was changed" + - string: + name: "conf_file" + default: ".ci/matrix_job.yaml" + description: "Regex to select job config file. Do not change it" + - string: + name: "DEBUG" + default: 0 + description: "Enable debug prints and traces, valid values are 0-9." + - bool: + name: "do_build" + default: true + description: "This verifies different configuration using gcc compiler." + - bool: + name: "do_compiler" + default: true + description: "Check ability to be built under icc, clang." + - bool: + name: "do_package" + default: true + description: "Check tar, source and binary packages." + - bool: + name: "do_cppcheck" + default: true + description: "Run static analysis using cppcheck tool." + - bool: + name: "do_csbuild" + default: true + description: "Run static analysis using csbuild tool." + - bool: + name: "do_service" + default: true + description: "Verify service." + - bool: + name: "do_style" + default: false + description: "Analysis source code for coding style." + - bool: + name: "do_coverity" + default: true + description: "Launch coverity verification." + - bool: + name: "do_coverity_snapshot" + default: false + description: "Submit Coverity Static Analysis as a snapshot (normally it should be checked only for master branch after proper defects review)" + - bool: + name: "do_test" + default: true + description: "Use runtime verification." + - bool: + name: "do_gtest" + default: true + description: "Use google tests." + - bool: + name: "do_valgrind" + default: true + description: "Use valgrind." + - bool: + name: "do_commit" + default: true + description: "Use commit message check." + - bool: + name: "do_artifact" + default: true + description: "Collect artifacts." + - bool: + name: "do_blackduck" + default: false + description: "Run BlackDuck." + - bool: + name: "do_copyrights" + default: true + description: "Check copyrights in source headers" + triggers: + - github-pull-request: + cron: 'H/5 * * * *' + trigger-phrase: '.*\bbot:retest\b.*' + status-context: "{jjb_proj}" + success-status: "[PASS]" + failure-status: "[FAIL]" + error-status: "[FAIL]" + status-add-test-results: true + auth-id: '2806c206-c725-4d8c-af4b-bedfc463b401' + org-list: ["Mellanox"] + white-list: ["swx-jenkins","swx-jenkins2","swx-jenkins3","mellanox-github"] + allow-whitelist-orgs-as-admins: true + cancel-builds-on-update: true + pipeline-scm: + scm: + - git: + url: "{jjb_git}" + credentials-id: 'b7d08ca7-378c-45d6-ac4b-3f30bdf49168' + branches: ['$sha1'] + shallow-clone: true + depth: 2 + refspec: "+refs/pull/*:refs/remotes/origin/pr/*" + browser: githubweb + browser-url: "{jjb_git}" + script-path: "{jjb_jenkinsfile}" + +- job-template: + name: "{jjb_proj}-redmine-issue" + project-type: pipeline + folder: "{jjb_folder}" + properties: + - github: + url: "https://github.com/Mellanox/libvma" + - build-discarder: + days-to-keep: 30 + num-to-keep: 30 + - inject: + keep-system-variables: true + properties-content: | + jjb_proj={jjb_proj} + description: The job is checking the RM issue. Do NOT edit this job through the Web GUI ! + concurrent: true + parameters: + - string: + name: "git_repository" + default: "ssh://git@github.com/mellanox/libvma" + description: "Git repository path." + - string: + name: "conf_file" + default: ".ci/pipeline/redmine_matrix_job.yaml" + description: "Regex to select job config file. Do not change it" + - string: + name: "MAIL_TO" + default: "nirni@mellanox.com" + description: "Whitespace-separated list of recipient addresses." + + wrappers: + - workspace-cleanup + - build-user-vars + - timestamps + + triggers: + - github-pull-request: + cron: 'H/5 * * * *' + trigger-phrase: '.*\bbot:(?:rm:)?retest\b.*' + status-context: "{jjb_proj}-redmine-issue" + success-status: "[PASS]" + failure-status: "[FAIL]" + error-status: "[FAIL]" + status-add-test-results: true + auth-id: '2806c206-c725-4d8c-af4b-bedfc463b401' + admin-list: ["Mellanox"] + org-list: ["Mellanox"] + white-list: ["Mellanox"] + allow-whitelist-orgs-as-admins: true + cancel-builds-on-update: true + + pipeline-scm: + scm: + - git: + url: "{jjb_git}" + credentials-id: 'b7d08ca7-378c-45d6-ac4b-3f30bdf49168' + branches: ['$sha1'] + shallow-clone: true + depth: 2 + refspec: "+refs/pull/*:refs/remotes/origin/pr/*" + browser: githubweb + browser-url: "{jjb_git}" + script-path: "{jjb_jenkinsfile}" + +- job-template: + name: "{jjb_proj}-release" + project-type: pipeline + folder: "{jjb_folder}" + properties: + - github: + url: "https://github.com/Mellanox/libvma" + - build-discarder: + days-to-keep: 50 + num-to-keep: 20 + - inject: + keep-system-variables: true + properties-content: | + jjb_proj={jjb_proj} + description: Do NOT edit this job through the Web GUI ! + concurrent: false + parameters: + - string: + name: "release_tag" + default: "" + description: "Tag to release" + - string: + name: sha1 + default: 'tags/$release_tag' + description: 'commit to use, defaults to the commit tag provided under release_tag' + - string: + name: "revision" + default: "1" + description: "Release revision" + - string: + name: "release_folder" + default: "/auto/mswg/release/vma" + description: "Folder to release packages into" + - bool: + name: "do_release" + default: true + description: "Release build packges into the release folder, set to false for debugging" + - string: + name: "notification_email" + default: "55ae26f6.NVIDIA.onmicrosoft.com@amer.teams.ms" + description: "Email to send report to upon success/failure" + - string: + name: "conf_file" + default: ".ci/pipeline/release_matrix_job.yaml" + description: "job config file. Do not change it" + pipeline-scm: + scm: + - git: + url: "{jjb_git}" + credentials-id: 'b7d08ca7-378c-45d6-ac4b-3f30bdf49168' + branches: ['$sha1'] + shallow-clone: true + depth: 2 + refspec: "+refs/pull/*:refs/remotes/origin/pr/*" + browser: githubweb + browser-url: "{jjb_git}" + script-path: "{jjb_jenkinsfile}" + +- project: + name: libvma + jjb_email: 'nwolfer@nvidia.com' + jjb_proj: 'LibVMA' + jjb_git: 'git@github.com:Mellanox/libvma.git' + jjb_owner: 'Nir Wolfer' + jjb_jenkinsfile: '.ci/pipeline/Jenkinsfile.shlib' + jjb_folder: 'libvma' + jjb_branch: 'master' + jobs: + - "{jjb_proj}" + - "{jjb_proj}-redmine-issue" + - "{jjb_proj}-release" diff --git a/.ci/redmine_matrix_job.yaml b/.ci/pipeline/redmine_matrix_job.yaml similarity index 100% rename from .ci/redmine_matrix_job.yaml rename to .ci/pipeline/redmine_matrix_job.yaml diff --git a/.ci/pipeline/release_jjb.yaml b/.ci/pipeline/release_jjb.yaml deleted file mode 100644 index cf07a66b9..000000000 --- a/.ci/pipeline/release_jjb.yaml +++ /dev/null @@ -1,65 +0,0 @@ -- job-template: - name: "{jjb_proj}" - project-type: pipeline - folder: libvma - properties: - - github: - url: "https://github.com/Mellanox/libvma" - - build-discarder: - days-to-keep: 50 - num-to-keep: 20 - - inject: - keep-system-variables: true - properties-content: | - jjb_proj={jjb_proj} - description: Do NOT edit this job through the Web GUI ! - concurrent: false - parameters: - - string: - name: "release_tag" - default: "" - description: "Tag to release" - - string: - name: sha1 - default: 'tags/$release_tag' - description: 'commit to use, defaults to the commit tag provided under release_tag' - - string: - name: "revision" - default: "1" - description: "Release revision" - - string: - name: "release_folder" - default: "/auto/mswg/release/vma" - description: "Folder to release packages into" - - bool: - name: "do_release" - default: true - description: "Release build packges into the release folder, set to false for debugging" - - string: - name: "notification_email" - default: "55ae26f6.NVIDIA.onmicrosoft.com@amer.teams.ms" - description: "Email to send report to upon success/failure" - - string: - name: "conf_file" - default: ".ci/pipeline/release_matrix_job.yaml" - description: "job config file. Do not change it" - pipeline-scm: - scm: - - git: - url: "{jjb_git}" - credentials-id: 'b7d08ca7-378c-45d6-ac4b-3f30bdf49168' - branches: ['$sha1'] - shallow-clone: true - depth: 2 - refspec: "+refs/pull/*:refs/remotes/origin/pr/*" - browser: githubweb - browser-url: "{jjb_git}" - script-path: ".ci/Jenkinsfile" -- project: - name: libvma - jjb_email: 'nwolfer@nvidia.com' - jjb_proj: 'LibVMA-release' - jjb_git: 'git@github.com:Mellanox/libvma.git' - jjb_owner: 'Nir Wolfer' - jobs: - - "{jjb_proj}" diff --git a/.ci/proj_jjb.yaml b/.ci/proj_jjb.yaml deleted file mode 100644 index 67c8db0eb..000000000 --- a/.ci/proj_jjb.yaml +++ /dev/null @@ -1,131 +0,0 @@ -- job-template: - name: "{jjb_proj}" - project-type: pipeline - folder: libvma - properties: - - github: - url: "https://github.com/Mellanox/libvma" - - build-discarder: - days-to-keep: 50 - num-to-keep: 20 - - inject: - keep-system-variables: true - properties-content: | - jjb_proj={jjb_proj} - description: Do NOT edit this job through the Web GUI ! - concurrent: false - parameters: - - string: - name: "sha1" - default: master - description: "Commit to be checked, set by PR" - - bool: - name: "build_dockers" - default: false - description: "Rebuild docker containers. Check this box if .ci/DockerFile* was changed" - - string: - name: "conf_file" - default: ".ci/matrix_job.yaml" - description: "Regex to select job config file. Do not change it" - - string: - name: "DEBUG" - default: 0 - description: "Enable debug prints and traces, valid values are 0-9." - - bool: - name: "do_build" - default: true - description: "This verifies different configuration using gcc compiler." - - bool: - name: "do_compiler" - default: true - description: "Check ability to be built under icc, clang." - - bool: - name: "do_package" - default: true - description: "Check tar, source and binary packages." - - bool: - name: "do_cppcheck" - default: true - description: "Run static analysis using cppcheck tool." - - bool: - name: "do_csbuild" - default: true - description: "Run static analysis using csbuild tool." - - bool: - name: "do_service" - default: true - description: "Verify service." - - bool: - name: "do_style" - default: false - description: "Analysis source code for coding style." - - bool: - name: "do_coverity" - default: true - description: "Launch coverity verification." - - bool: - name: "do_coverity_snapshot" - default: false - description: "Submit Coverity Static Analysis as a snapshot (normally it should be checked only for master branch after proper defects review)" - - bool: - name: "do_test" - default: true - description: "Use runtime verification." - - bool: - name: "do_gtest" - default: true - description: "Use google tests." - - bool: - name: "do_valgrind" - default: true - description: "Use valgrind." - - bool: - name: "do_commit" - default: true - description: "Use commit message check." - - bool: - name: "do_artifact" - default: true - description: "Collect artifacts." - - bool: - name: "do_blackduck" - default: false - description: "Run BlackDuck." - - bool: - name: "do_copyrights" - default: true - description: "Check copyrights in source headers" - triggers: - - github-pull-request: - cron: 'H/5 * * * *' - trigger-phrase: '.*\bbot:retest\b.*' - status-context: ""{jjb_proj}"" - success-status: "[PASS]" - failure-status: "[FAIL]" - error-status: "[FAIL]" - status-add-test-results: true - auth-id: '2806c206-c725-4d8c-af4b-bedfc463b401' - org-list: ["Mellanox"] - white-list: ["swx-jenkins","swx-jenkins2","swx-jenkins3","mellanox-github"] - allow-whitelist-orgs-as-admins: true - cancel-builds-on-update: true - pipeline-scm: - scm: - - git: - url: "{jjb_git}" - credentials-id: 'b7d08ca7-378c-45d6-ac4b-3f30bdf49168' - branches: ['$sha1'] - shallow-clone: true - depth: 2 - refspec: "+refs/pull/*:refs/remotes/origin/pr/*" - browser: githubweb - browser-url: "{jjb_git}" - script-path: ".ci/Jenkinsfile" -- project: - name: libvma - jjb_email: 'nwolfer@nvidia.com' - jjb_proj: 'LibVMA' - jjb_git: 'git@github.com:Mellanox/libvma.git' - jjb_owner: 'Nir Wolfer' - jobs: - - "{jjb_proj}" diff --git a/.ci/redmine_jjb.yaml b/.ci/redmine_jjb.yaml deleted file mode 100644 index 09ca2fd61..000000000 --- a/.ci/redmine_jjb.yaml +++ /dev/null @@ -1,71 +0,0 @@ -- job-template: - name: "{jjb_proj}" - project-type: pipeline - folder: libvma - properties: - - github: - url: "https://github.com/Mellanox/libvma" - - build-discarder: - days-to-keep: 30 - num-to-keep: 30 - - inject: - keep-system-variables: true - properties-content: | - jjb_proj={jjb_proj} - description: The job is checking the RM issue. Do NOT edit this job through the Web GUI ! - concurrent: true - parameters: - - string: - name: "git_repository" - default: "ssh://git@github.com/mellanox/libvma" - description: "Git repository path." - - string: - name: "conf_file" - default: ".ci/redmine_matrix_job.yaml" - description: "Regex to select job config file. Do not change it" - - string: - name: "MAIL_TO" - default: "nirni@mellanox.com" - description: "Whitespace-separated list of recipient addresses." - - wrappers: - - workspace-cleanup - - build-user-vars - - timestamps - - triggers: - - github-pull-request: - cron: 'H/5 * * * *' - trigger-phrase: '.*\bbot:(?:rm:)?retest\b.*' - status-context: "{jjb_proj}" - success-status: "[PASS]" - failure-status: "[FAIL]" - error-status: "[FAIL]" - status-add-test-results: true - auth-id: '2806c206-c725-4d8c-af4b-bedfc463b401' - admin-list: ["Mellanox"] - org-list: ["Mellanox"] - white-list: ["Mellanox"] - allow-whitelist-orgs-as-admins: true - cancel-builds-on-update: true - - pipeline-scm: - scm: - - git: - url: "{jjb_git}" - credentials-id: 'b7d08ca7-378c-45d6-ac4b-3f30bdf49168' - branches: ['$sha1'] - shallow-clone: true - depth: 2 - refspec: "+refs/pull/*:refs/remotes/origin/pr/*" - browser: githubweb - browser-url: "{jjb_git}" - script-path: ".ci/Jenkinsfile" -- project: - name: libvma - jjb_email: 'nwolfer@nvidia.com' - jjb_proj: 'LibVMA-redmine-issue' - jjb_git: 'git@github.com:Mellanox/libvma.git' - jjb_owner: 'Nir Wolfer' - jobs: - - "{jjb_proj}"