Skip to content

Commit

Permalink
Trigger BMO e2e tests through prow
Browse files Browse the repository at this point in the history
This is to verify that the jenkins operator for prow works as expected.
The idea is to trigger jenkins jobs through prow instead of through the
ghprb jenkins plugin. When we have verified that this works, we can
continue with the rest of the jenkins jobs and remove the ghprb
triggers.

Signed-off-by: Lennart Jern <[email protected]>
  • Loading branch information
lentzi90 committed Jan 17, 2024
1 parent b11a5c6 commit 8108028
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
13 changes: 8 additions & 5 deletions jenkins/jobs/bmo_e2e_tests.pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import java.text.SimpleDateFormat
def TIMEOUT = 3600

// Set defaults for non-PR jobs
def branch = env.ghprbActualCommit ?: "main"
def repoUrl = env.ghprbAuthorRepoGitUrl ?: "https://github.com/metal3-io/baremetal-operator.git"
def pullSha = (env.PULL_PULL_SHA) ?: "main"
def repoUrl = "https://github.com/metal3-io/baremetal-operator.git"
// Fetch the main branch and the pullSha, nothing else
def refspec = '+refs/heads/main:refs/remotes/origin/main ' + pullSha

pipeline {
agent none
Expand All @@ -26,11 +28,12 @@ pipeline {
stage("Checkout source code") {
steps {
checkout scmGit(
branches: [[name: branch]],
userRemoteConfigs: [[url: repoUrl, credentialsId: "metal3-jenkins-github-token"]],
branches: [[name: pullSha]],
userRemoteConfigs: [[url: repoUrl, credentialsId: "metal3-jenkins-github-token", refspec: refspec]],
extensions: [[$class: "WipeWorkspace"],
[$class: "CleanCheckout"],
[$class: "CleanBeforeCheckout"]],
[$class: "CleanBeforeCheckout"],
cloneOption(honorRefspec: true)],
submoduleCfg: [],)
script {
CURRENT_START_TIME = System.currentTimeMillis()
Expand Down
13 changes: 9 additions & 4 deletions prow/manifests/overlays/metal3/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,7 @@ branch-protection:
[
"test-centos-e2e-integration-main",
"test-ubuntu-integration-main",
"metal3-bmo-e2e-test",
]
release-0.5:
required_status_checks:
contexts: ["metal3-bmo-e2e-test"]
cluster-api-provider-metal3:
branches:
main:
Expand Down Expand Up @@ -540,6 +536,15 @@ presubmits:
value: "/"
image: ghcr.io/yannh/kubeconform:v0.6.2-alpine@sha256:49b5f6b320d30c1b8b72a7abdf02740ac9dc36a3ba23b934d1c02f7b37e6e740
imagePullPolicy: Always
- name: metal3-bmo-e2e-test-pull
# E2e tests do not exist before release-0.5
branches:
- main
- release-0.5
agent: jenkins
# Don't run unless triggered to avoid wasting resources
always_run: false
optional: false

metal3-io/cluster-api-provider-metal3:
- name: gomod
Expand Down

0 comments on commit 8108028

Please sign in to comment.