diff --git a/jenkins/jobs/prow_integration_tests.pipeline b/jenkins/jobs/prow_integration_tests.pipeline index e434ae2a..3f87a405 100644 --- a/jenkins/jobs/prow_integration_tests.pipeline +++ b/jenkins/jobs/prow_integration_tests.pipeline @@ -11,12 +11,12 @@ KUBECTL_SHA256=(env.KUBECTL_SHA256) script { UPDATED_REPO = "https://github.com/${env.REPO_OWNER}/${env.REPO_NAME}.git" - ci_git_url = "https://github.com/metal3-io/project-infra.git" + ci_git_url = "https://github.com/Nordix/metal3-project-infra.git" if ("${PROJECT_REPO_ORG}" == "metal3-io" && "${PROJECT_REPO_NAME}" == "project-infra") { - ci_git_branch = (env.PULL_PULL_SHA) ?: (env.ghprbActualCommit) ?: "main" + ci_git_branch = (env.PULL_PULL_SHA) ?: (env.ghprbActualCommit) ?: "fetch-changes-from-pr-id/mboukhalfa" } else { - ci_git_branch = "main" + ci_git_branch = "fetch-changes-from-pr-id/mboukhalfa" } echo "Checkout ${ci_git_url} branch ${ci_git_branch}" diff --git a/jenkins/scripts/files/run_integration_tests.sh b/jenkins/scripts/files/run_integration_tests.sh index 9a93e23a..989a2075 100755 --- a/jenkins/scripts/files/run_integration_tests.sh +++ b/jenkins/scripts/files/run_integration_tests.sh @@ -122,6 +122,8 @@ if [[ "${UPDATED_REPO}" != *"${REPO_ORG}/${REPO_NAME}"* ]] || git config user.name "Test" git remote add test "${UPDATED_REPO}" git fetch test + # if triggered from prow we cannot get the ghprbAuthorRepoGitUrl then we pull the PR + git fetch origin "pull/${PR_ID:-0}/head:${UPDATED_BRANCH}-branch" || true # Merging the PR with the target branch git merge "${UPDATED_BRANCH}" || exit fi diff --git a/jenkins/scripts/integration_test.sh b/jenkins/scripts/integration_test.sh index 2190f55f..3b07293f 100755 --- a/jenkins/scripts/integration_test.sh +++ b/jenkins/scripts/integration_test.sh @@ -30,6 +30,7 @@ REPO_ORG="${REPO_ORG:-metal3-io}" REPO_NAME="${REPO_NAME:-metal3-dev-env}" UPDATED_REPO="${UPDATED_REPO:-https://github.com/${REPO_ORG}/${REPO_NAME}.git}" UPDATED_BRANCH="${UPDATED_BRANCH:-main}" +PR_ID="${PR_ID:-0}" CAPI_VERSION="${CAPI_VERSION:-v1beta1}" CAPM3_VERSION="${CAPM3_VERSION:-v1beta1}" CAPM3RELEASEBRANCH="${CAPM3RELEASEBRANCH:-main}" @@ -140,6 +141,7 @@ REPO_NAME="${REPO_NAME}" REPO_BRANCH="${REPO_BRANCH}" UPDATED_REPO="${UPDATED_REPO}" UPDATED_BRANCH="${UPDATED_BRANCH}" +PR_ID="${PR_ID}" CAPI_VERSION="${CAPI_VERSION}" CAPM3_VERSION="${CAPM3_VERSION}" CAPM3RELEASEBRANCH="${CAPM3RELEASEBRANCH}"