Merge "convert fullstack ghprb PR test job to prow job"
diff --git a/jjb/metal3/job_fullstack_project-infra_building_test.yml b/jjb/metal3/job_fullstack_project_infra_building_test_prow.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 ad450df..da043dd 100644
--- a/jjb/metal3/job_fullstack_project-infra_building_test.yml
+++ b/jjb/metal3/job_fullstack_project_infra_building_test_prow.yml
@@ -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
@@ -54,10 +54,6 @@
         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'
         description: 'Ironic Python Agent repository branch to build'
@@ -150,29 +146,36 @@
         default: 'HEAD'
         description: 'Cluster API Git repository commit hash to build'
     - 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: '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'
-    - string:
-        name: ghprbTargetBranch
-        default: 'main'
-        description: 'Target branch of the PR'
-    - string:
         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: 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'
+    - string:
+        name: PULL_NUMBER
+        description: 'Pull request number'
+    # End of Prow parameters
 
     properties:
     - build-discarder:
@@ -180,30 +183,9 @@
         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:
@@ -217,9 +199,11 @@
           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
diff --git a/jjb/metal3/job_periodic_fullstack_building.yml b/jjb/metal3/job_periodic_fullstack_building.yml
index 290e592..7fe089f 100644
--- a/jjb/metal3/job_periodic_fullstack_building.yml
+++ b/jjb/metal3/job_periodic_fullstack_building.yml
@@ -54,10 +54,6 @@
         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'
         description: 'Ironic Python Agent repository branch to build'
@@ -153,6 +149,24 @@
         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:
diff --git a/jjb/metal3/projects.yml b/jjb/metal3/projects.yml
index 6d3657f..ad34e10 100644
--- a/jjb/metal3/projects.yml
+++ b/jjb/metal3/projects.yml
@@ -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: