Skip to content

Commit

Permalink
Dynamic branch specifier for E2E tests jobs (#3113)
Browse files Browse the repository at this point in the history
* Add a branch specifier parameter to dynamically checkout a given
sha1, branch or tag in the E2E tests jobs.
* Propagate the git commit that triggers a nightly or release build to
the E2E tests jobs that are triggered after a successful build.
  • Loading branch information
thbkrkr authored and sebgl committed May 25, 2020
1 parent 936a0aa commit 44f933b
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 15 deletions.
8 changes: 6 additions & 2 deletions .ci/jobs/e2e-tests-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
name: cloud-on-k8s-e2e-tests-aks
project-type: pipeline
parameters:
- string:
name: branch_specifier
default: master
description: "the Git branch specifier to build (<branchName>,<tagName>, <commitId>, etc.)"
- string:
name: JKS_PARAM_OPERATOR_IMAGE
description: "ECK Docker image"
Expand All @@ -16,7 +20,7 @@
- git:
url: https://github.com/elastic/cloud-on-k8s
branches:
- master
- ${branch_specifier}
credentials-id: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba'
script-path: .ci/pipelines/e2e-tests-aks.Jenkinsfile
lightweight-checkout: true
lightweight-checkout: false
8 changes: 6 additions & 2 deletions .ci/jobs/e2e-tests-gke-k8s-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
name: cloud-on-k8s-e2e-tests-gke-k8s-versions
project-type: pipeline
parameters:
- string:
name: branch_specifier
default: master
description: "the Git branch specifier to build (<branchName>,<tagName>, <commitId>, etc.)"
- string:
name: JKS_PARAM_OPERATOR_IMAGE
description: "ECK Docker image"
Expand All @@ -16,7 +20,7 @@
- git:
url: https://github.com/elastic/cloud-on-k8s
branches:
- master
- ${branch_specifier}
credentials-id: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba'
script-path: .ci/pipelines/e2e-tests-gke-k8s-versions.Jenkinsfile
lightweight-checkout: true
lightweight-checkout: false
8 changes: 6 additions & 2 deletions .ci/jobs/e2e-tests-kind-k8s-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
name: cloud-on-k8s-e2e-tests-kind-k8s-versions
project-type: pipeline
parameters:
- string:
name: branch_specifier
default: master
description: "the Git branch specifier to build (<branchName>,<tagName>, <commitId>, etc.)"
- string:
name: JKS_PARAM_OPERATOR_IMAGE
description: "ECK Docker image"
Expand All @@ -16,7 +20,7 @@
- git:
url: https://github.com/elastic/cloud-on-k8s
branches:
- master
- ${branch_specifier}
credentials-id: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba'
script-path: .ci/pipelines/e2e-tests-kind-k8s-versions.Jenkinsfile
lightweight-checkout: true
lightweight-checkout: false
8 changes: 6 additions & 2 deletions .ci/jobs/e2e-tests-ocp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
name: cloud-on-k8s-e2e-tests-ocp
project-type: pipeline
parameters:
- string:
name: branch_specifier
default: master
description: "the Git branch specifier to build (<branchName>,<tagName>, <commitId>, etc.)"
- string:
name: JKS_PARAM_OPERATOR_IMAGE
description: "ECK Docker image"
Expand All @@ -16,7 +20,7 @@
- git:
url: https://github.com/elastic/cloud-on-k8s
branches:
- master
- ${branch_specifier}
credentials-id: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba'
script-path: .ci/pipelines/e2e-tests-ocp.Jenkinsfile
lightweight-checkout: true
lightweight-checkout: false
8 changes: 6 additions & 2 deletions .ci/jobs/e2e-tests-stack-versions-gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
name: cloud-on-k8s-e2e-tests-stack-versions
project-type: pipeline
parameters:
- string:
name: branch_specifier
default: master
description: "the Git branch specifier to build (<branchName>,<tagName>, <commitId>, etc.)"
- string:
name: JKS_PARAM_OPERATOR_IMAGE
description: "ECK Docker image"
Expand All @@ -16,7 +20,7 @@
- git:
url: https://github.com/elastic/cloud-on-k8s
branches:
- master
- ${branch_specifier}
credentials-id: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba'
script-path: .ci/pipelines/e2e-tests-stack-versions-gke.Jenkinsfile
lightweight-checkout: true
lightweight-checkout: false
25 changes: 20 additions & 5 deletions .ci/pipelines/build.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,38 @@ pipeline {
def operatorImage = sh(returnStdout: true, script: 'make print-operator-image').trim()

build job: 'cloud-on-k8s-e2e-tests-stack-versions',
parameters: [string(name: 'JKS_PARAM_OPERATOR_IMAGE', value: operatorImage)],
parameters: [
string(name: 'JKS_PARAM_OPERATOR_IMAGE', value: operatorImage),
string(name: 'branch_specifier', value: GIT_COMMIT)
],
wait: false

build job: 'cloud-on-k8s-e2e-tests-gke-k8s-versions',
parameters: [string(name: 'JKS_PARAM_OPERATOR_IMAGE', value: operatorImage)],
parameters: [
string(name: 'JKS_PARAM_OPERATOR_IMAGE', value: operatorImage),
string(name: 'branch_specifier', value: GIT_COMMIT)
],
wait: false

build job: 'cloud-on-k8s-e2e-tests-aks',
parameters: [string(name: 'JKS_PARAM_OPERATOR_IMAGE', value: operatorImage)],
parameters: [
string(name: 'JKS_PARAM_OPERATOR_IMAGE', value: operatorImage),
string(name: 'branch_specifier', value: GIT_COMMIT)
],
wait: false

build job: 'cloud-on-k8s-e2e-tests-kind-k8s-versions',
parameters: [string(name: 'JKS_PARAM_OPERATOR_IMAGE', value: operatorImage)],
parameters: [
string(name: 'JKS_PARAM_OPERATOR_IMAGE', value: operatorImage),
string(name: 'branch_specifier', value: GIT_COMMIT)
],
wait: false

build job: 'cloud-on-k8s-e2e-tests-ocp',
parameters: [string(name: 'JKS_PARAM_OPERATOR_IMAGE', value: operatorImage)],
parameters: [
string(name: 'JKS_PARAM_OPERATOR_IMAGE', value: operatorImage),
string(name: 'branch_specifier', value: GIT_COMMIT)
],
wait: false
}
}
Expand Down

0 comments on commit 44f933b

Please sign in to comment.