mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-10 08:20:23 +00:00
5f9222d7ee
The batch job templates for OpenShift use a GIT_REF variable that is used by the jobs to checkout the repository. This defaults to "ci/centos", but it never is adjusted when jjb-validate runs against a PR. With the new GIT_REF environment variable in the jjb.sh script, the variable can now be used to checkout a PR from gitHub and run the validation against that. Signed-off-by: Niels de Vos <ndevos@redhat.com>
42 lines
1.1 KiB
YAML
42 lines
1.1 KiB
YAML
---
|
|
- job:
|
|
name: jjb-validate
|
|
project-type: pipeline
|
|
concurrent: true
|
|
properties:
|
|
- github:
|
|
url: https://github.com/ceph/ceph-csi
|
|
- build-discarder:
|
|
days-to-keep: 7
|
|
artifact-days-to-keep: 7
|
|
parameters:
|
|
dsl: |
|
|
def GIT_REPO = 'https://github.com/ceph/ceph-csi'
|
|
def GIT_BRANCH = 'ci/centos'
|
|
|
|
if (params.ghprbPullId != null) {
|
|
GIT_BRANCH = "pull/${ghprbPullId}/head"
|
|
}
|
|
|
|
node {
|
|
stage('checkout ci repository') {
|
|
checkout([$class: 'GitSCM', branches: [[name: 'FETCH_HEAD']],
|
|
userRemoteConfigs: [[url: "${GIT_REPO}",
|
|
refspec: "${GIT_BRANCH}"]]])
|
|
}
|
|
stage('validation') {
|
|
sh "GIT_REF=${GIT_BRANCH} ./deploy/jjb.sh validate"
|
|
}
|
|
}
|
|
triggers:
|
|
- github-pull-request:
|
|
status-context: ci/centos/jjb-validate
|
|
trigger-phrase: '/(re)?test ((all)|(ci/centos/jjb-validate))'
|
|
permit-all: true
|
|
github-hooks: true
|
|
white-list-target-branches:
|
|
- ci/centos
|
|
org-list:
|
|
- ceph
|
|
allow-whitelist-orgs-as-admins: true
|