From: Lennart Jern Date: Wed, 2 Feb 2022 10:34:11 +0000 (+0200) Subject: Parameterize DISTRIBUTION and merge job templates X-Git-Url: https://gerrit.nordix.org/gitweb?a=commitdiff_plain;h=3e6135cd4e14497f2d71fb9cfe146c6dab5b8075;p=infra%2Fcicd.git Parameterize DISTRIBUTION and merge job templates This is an attempt to merge job templates for v1a4_integration_tests so that instead of having one template for ubuntu and one for centos, we have a single template and use the distribution variable to render two separate jobs (for ubuntu and centos respectively). Change-Id: I0d9563f1f2d545f5aa32f1a9418df63314fa0b4a --- diff --git a/jjb/metal3/job_capm3_v1a4_integration_tests_centos.yml b/jjb/metal3/job_capm3_v1a4_integration_tests.yml similarity index 92% rename from jjb/metal3/job_capm3_v1a4_integration_tests_centos.yml rename to jjb/metal3/job_capm3_v1a4_integration_tests.yml index 51ee1bf1c..feb4d7d2b 100644 --- a/jjb/metal3/job_capm3_v1a4_integration_tests_centos.yml +++ b/jjb/metal3/job_capm3_v1a4_integration_tests.yml @@ -25,9 +25,9 @@ # pipeline job. The pipeline scripts are maintained in Metal3 CI project infra repository. - job-template: - id: capm3_v1a4_integration_tests_centos - name: '{job_prefix}_{name}_v1a4_integration_test_centos' - description: "CAPM3 v1alpha4 integration tests for {repo[org]}/{repo[name]} on CentOS." + id: capm3_v1a4_integration_tests + name: '{job_prefix}_{name}_v1a4_integration_test_{distribution}' + description: "CAPM3 v1alpha4 integration tests for {repo[org]}/{repo[name]} on {distribution}." project-type: pipeline defaults: global disabled: False @@ -55,7 +55,7 @@ description: 'Target branch of the PR' - string: name: DISTRIBUTION - default: 'centos' + default: '{distribution}' description: 'Distribution to use for the target host and the tests. Can be ubuntu or centos' - string: name: CAPI_VERSION @@ -86,7 +86,7 @@ org-list: "{ci_github_whitelist_org}" cron: 'H/5 * * * *' auth-id: "{ci_ghprb_auth_id}" - trigger-phrase: '((.|\n)*\s)?/test-v1a4-centos-integration(\s(.|\n)*)?' + trigger-phrase: '((.|\n)*\s)?/test-v1a4-{distribution}-integration(\s(.|\n)*)?' skip-build-phrase: '/skip-test' only-trigger-phrase: True github-hooks: True @@ -98,7 +98,7 @@ - 'main' - 'release-0.4' - 'release-0.0' - status-context: "test-v1a4-centos-integration" + status-context: "test-v1a4-{distribution}-integration" success-status: "Passed" failure-status: "Failed" error-status: "Error" diff --git a/jjb/metal3/job_capm3_v1a4_integration_tests_ubuntu.yml b/jjb/metal3/job_capm3_v1a4_integration_tests_ubuntu.yml deleted file mode 100644 index 3aac6dc3e..000000000 --- a/jjb/metal3/job_capm3_v1a4_integration_tests_ubuntu.yml +++ /dev/null @@ -1,119 +0,0 @@ ---- -# -# ============LICENSE_START======================================================= -# Copyright (C) 2019 Nordix Foundation. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# ============LICENSE_END========================================================= - -# Description: -# ============ -# This file contains job template definition for Cluster API Provider Metal3 (CAPM3) integration tests. -# This job can be triggered manually or through a Github pull request. It creates a -# pipeline job. The pipeline scripts are maintained in Metal3 CI project infra repository. - -- job-template: - id: capm3_v1a4_integration_tests_ubuntu - name: '{job_prefix}_{name}_v1a4_integration_test_ubuntu' - description: "CAPM3 v1alpha4 integration tests for {repo[org]}/{repo[name]} on Ubuntu." - project-type: pipeline - defaults: global - disabled: False - concurrent: True - parameters: - - string: - name: PROJECT_REPO_ORG - default: '{repo[org]}' - description: 'Project github repo org name' - - string: - name: PROJECT_REPO_NAME - default: '{repo[name]}' - description: 'Project github repo name' - - string: - name: ghprbActualCommit - default: 'master' - description: 'CI Repo branch for triggering manual build' - - string: - name: ghprbAuthorRepoGitUrl - default: 'https://github.com/{repo[org]}/{repo[name]}.git' - description: 'CI Repo URL for triggering manual build' - - string: - name: ghprbTargetBranch - default: 'master' - description: 'Target branch of the PR' - - string: - name: DISTRIBUTION - default: 'ubuntu' - description: 'Distribution to use for the target host and the tests. Can be ubuntu or centos' - - string: - name: CAPI_VERSION - default: 'v1alpha3' - description: 'Cluster API version. Can be v1alpha3.' - - string: - name: CAPM3_VERSION - default: 'v1alpha4' - description: 'Cluster API provider Metal3 version. Can be v1alpha4 or v1alpha5.' - - string: - name: TARGET_NODE_MEMORY - default: 4096 - description: 'RAM size of the target host.' - - properties: - - build-discarder: - days-to-keep: 30 - num-to-keep: 300 - artifact-days-to-keep: -1 - artifact-num-to-keep: -1 - - github: - url: https://github.com/{repo[org]}/{repo[name]} - - triggers: - - github-pull-request: - admin-list: - - '{ci_github_admin_user}' - org-list: "{ci_github_whitelist_org}" - cron: 'H/5 * * * *' - auth-id: "{ci_ghprb_auth_id}" - trigger-phrase: '((.|\n)*\s)?/test-v1a4-integration(\s(.|\n)*)?' - skip-build-phrase: '/skip-test' - only-trigger-phrase: True - github-hooks: True - permit-all: False - auto-close-on-fail: False - allow-whitelist-orgs-as-admins: True - white-list-target-branches: - - 'master' - - 'main' - - 'release-0.4' - - 'release-0.0' - status-context: "test-v1a4-integration" - success-status: "Passed" - failure-status: "Failed" - error-status: "Error" - cancel-builds-on-update: True - pipeline-scm: - scm: - - git: - url: "{ci_github_repo}" - credentials-id: "{ci_github_jenkins_credentials_id}" - branches: - - '{branch|main}' - name: 'origin' - refspec: '+refs/heads/*:refs/remotes/origin/*' - wipe-workspace: True - honor-refspec: True - shallow-clone: False - script-path: "{ci_github_pipeline}" - lightweight-checkout: False diff --git a/jjb/metal3/projects.yml b/jjb/metal3/projects.yml index ef6530e38..50e3a1332 100644 --- a/jjb/metal3/projects.yml +++ b/jjb/metal3/projects.yml @@ -58,8 +58,10 @@ name: "project-infra" ci_github_repo: '${{ghprbAuthorRepoGitUrl}}' jobs: - - capm3_v1a4_integration_tests_centos - - capm3_v1a4_integration_tests_ubuntu + - capm3_v1a4_integration_tests: + distribution: + - ubuntu + - centos - capm3_v1a5_integration_tests_centos - capm3_v1a5_integration_tests_ubuntu - capm3_v1b1_integration_tests_centos @@ -88,8 +90,10 @@ org: "metal3-io" name: "baremetal-operator" jobs: - - capm3_v1a4_integration_tests_centos - - capm3_v1a4_integration_tests_ubuntu + - capm3_v1a4_integration_tests: + distribution: + - ubuntu + - centos - capm3_v1a5_integration_tests_centos - capm3_v1a5_integration_tests_ubuntu - capm3_v1b1_integration_tests_centos @@ -106,8 +110,10 @@ org: "metal3-io" name: "ip-address-manager" jobs: - - capm3_v1a4_integration_tests_centos - - capm3_v1a4_integration_tests_ubuntu + - capm3_v1a4_integration_tests: + distribution: + - ubuntu + - centos - capm3_v1a5_integration_tests_centos - capm3_v1a5_integration_tests_ubuntu - capm3_v1b1_integration_tests_centos @@ -120,8 +126,10 @@ - project: name: "metal3_dev_env" jobs: - - capm3_v1a4_integration_tests_centos - - capm3_v1a4_integration_tests_ubuntu + - capm3_v1a4_integration_tests: + distribution: + - ubuntu + - centos - capm3_v1a4_main_integration_tests_centos - capm3_v1a4_main_integration_tests_ubuntu - capm3_v1a5_integration_tests_centos @@ -155,8 +163,10 @@ org: "metal3-io" name: "cluster-api-provider-metal3" jobs: - - capm3_v1a4_integration_tests_centos - - capm3_v1a4_integration_tests_ubuntu + - capm3_v1a4_integration_tests: + distribution: + - ubuntu + - centos - capm3_v1a5_integration_tests_centos - capm3_v1a5_integration_tests_ubuntu - capm3_v1a5_e2e_tests_ubuntu @@ -182,8 +192,10 @@ org: "metal3-io" name: "ironic-image" jobs: - - capm3_v1a4_integration_tests_centos - - capm3_v1a4_integration_tests_ubuntu + - capm3_v1a4_integration_tests: + distribution: + - ubuntu + - centos - capm3_v1a5_integration_tests_centos - capm3_v1a5_integration_tests_ubuntu - capm3_v1b1_integration_tests_centos @@ -199,7 +211,8 @@ org: "metal3-io" name: "ironic-ipa-downloader" jobs: - - capm3_v1a4_integration_tests_ubuntu + - capm3_v1a4_integration_tests: + distribution: ubuntu - capm3_v1a5_integration_tests_ubuntu - capm3_v1b1_integration_tests_centos - capm3_v1b1_integration_tests_ubuntu