convert fullstack ghprb PR test job to prow job 64/22464/4
authorAdam Rozman <adam.rozman@est.tech>
Tue, 29 Oct 2024 10:59:09 +0000 (12:59 +0200)
committerAdam Rozman <adam.rozman@est.tech>
Tue, 29 Oct 2024 13:24:06 +0000 (15:24 +0200)
This commit:
 - Configures both the PR and the periodic fullstack jobs to use the
   dynamic pipeline script.
 - Adds Prow specific parameters for both the PR and periodic fullstack
   test jjbs.
 - Removes the IPA_REF parameter from both the PR and the periodic fullstack
   jobs as that parameter will have no role in the future in the IPA building.

Notes:
 - The PR fullstack test is planned to be triggered by Prow.

Signed-off-by: Adam Rozman <adam.rozman@est.tech>
Change-Id: I322a9442ea5e5beb861cc94ea200f36548dfad9b

jjb/metal3/job_fullstack_project_infra_building_test_prow.yml [moved from jjb/metal3/job_fullstack_project-infra_building_test.yml with 78% similarity]
jjb/metal3/job_periodic_fullstack_building.yml
jjb/metal3/projects.yml

similarity index 78%
rename from jjb/metal3/job_fullstack_project-infra_building_test.yml
rename to jjb/metal3/job_fullstack_project_infra_building_test_prow.yml
index ad450df6fc8f16154804bebe8ae21ff1c72b4191..da043dd889c0bda053d91ac62d8afc6c3759c7f7 100644 (file)
@@ -25,8 +25,8 @@
 # The pipeline scripts are maintained in Nordix/metal3-dev-tools repository.
 
 - job-template:
-    id: fullstack_project-infra_building
-    name: '{job_prefix}_fullstack_project-infra_building'
+    id: fullstack_project_infra_building_test_prow
+    name: '{job_prefix}-project-infra-fullstack-test'
     description: "Build and test a Metal3 cluster stack from source."
     project-type: pipeline
     defaults: global
         name: IPA_REPO
         default: 'https://opendev.org/openstack/ironic-python-agent.git'
         description: "The default Git repository of IPA"
-    - string:
-        name: IPA_REF
-        default: 'HEAD'
-        description: 'Ironic Python Agent repository reference to use for the build. Example: refs/changes/84/800084/22'
     - string:
         name: IPA_BRANCH
         default: 'master'
         default: 'HEAD'
         description: 'Cluster API Git repository commit hash to build'
     - string:
-        name: PROJECT_REPO_ORG
-        default: '{repo[org]}'
+        name: STAGING
+        default: 'false'
+        description: 'Configures IPA builder upload mode (staging/review)'
+    # Parameters set by Prow
+    - string:
+        name: BUILD_ID
+        description: 'Used by Prow when triggering jobs'
+    - string:
+        name: PROW_JOB_ID
+        description: 'Used by Prow when triggering jobs'
+    - string:
+        name: REPO_OWNER
+        default: 'metal3-io'
         description: 'Project github repo org name'
     - string:
-        name: PROJECT_REPO_NAME
-        default: '{repo[name]}'
+        name: REPO_NAME
+        default: 'project-infra'
         description: 'Project github repo name'
     - string:
-        name: ghprbActualCommit
+        name: PULL_BASE_REF
         default: 'main'
-        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'
+        description: 'Ref name of the base branch'
     - string:
-        name: ghprbTargetBranch
+        name: PULL_PULL_SHA
         default: 'main'
-        description: 'Target branch of the PR'
+        description: 'Pull request head SHA'
     - string:
-        name: STAGING
-        default: 'false'
-        description: 'Configures IPA builder upload mode (staging/review)'
+        name: PULL_NUMBER
+        description: 'Pull request number'
+    # End of Prow parameters
 
     properties:
     - build-discarder:
         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: '.*?/test-metal3-fullstack.*?'
-        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:
-          - 'main'
-        status-context: "test-metal3-fullstack"
-        success-status: "Passed"
-        failure-status: "Failed"
-        error-status: "Error"
-        cancel-builds-on-update: True
+    triggers: []
+
     pipeline-scm:
       scm:
       - git:
           honor-refspec: True
           shallow-clone: False
           included-regions:
-                - "jenkins/scripts/ipa_builder_elements/.*"
-                - "jenkins/scripts/build_ipa.sh"
-                - "jenkins/scripts/run_build_ironic.sh"
-                - "jenkins/scripts/start_centos_fullstack_build.sh"
-      script-path: "jenkins/jobs/fullstack_building.pipeline"
+              - "jenkins/scripts/artifactory/.*"
+              - "jenkins/scripts/harbor/.*"
+              - "jenkins/scripts/dynamic_worker_workflow/ipa_builder_elements/.*"
+              - "jenkins/scripts/dynamic_worker_workflow/build_ipa.sh"
+              - "jenkins/scripts/dynamic_worker_workflow/fullstack.sh"
+              - "jenkins/scripts/dynamic_worker_workflow/fullstack_build_ironic.sh"
+      script-path: "jenkins/jobs/dynamic_fullstack_building.pipeline"
       lightweight-checkout: False
index 290e592a107e6e4d7103f0ee543b7c919a93651c..7fe089f32d45f1741f60e00e5bd54b67f211bedf 100644 (file)
         name: IPA_REPO
         default: 'https://opendev.org/openstack/ironic-python-agent.git'
         description: "The default Git repository of IPA"
-    - string:
-        name: IPA_REF
-        default: 'HEAD'
-        description: 'Ironic Python Agent repository reference to use for the build. Example: refs/changes/84/800084/22'
     - string:
         name: IPA_BRANCH
         default: 'master'
         name: STAGING
         default: 'true'
         description: 'Configures IPA builder upload mode (staging/review)'
+    # Fakeing Prow parameters
+    - string:
+        name: REPO_OWNER
+        default: 'metal3-io'
+        description: 'Project github repo org name'
+    - string:
+        name: REPO_NAME
+        default: 'project-infra'
+        description: 'Project github repo name'
+    - string:
+        name: PULL_BASE_REF
+        default: 'main'
+        description: 'Ref name of the base branch'
+    - string:
+        name: PULL_PULL_SHA
+        default: 'main'
+        description: 'Pull request head SHA'
+    # End of fakeing Prow parameters
 
     properties:
     - github:
index f89e3f3e49b0b5ef1f60296d5c304e4b9307fd24..0423fdfac2d6c220e052ce9d6cfa42fd8dc98634 100644 (file)
@@ -66,7 +66,7 @@
       org: "metal3-io"
       name: "project-infra"
     jobs:
-    - fullstack_project-infra_building
+    - fullstack_project_infra_building_test_prow
     - periodic_fullstack_building
 
 - project: