ci: Add the ability to run JJB from private branch/fork

Add the ability to run JJB from private branch/fork

jjb-deploy.yaml:
- Add GIT_REPO parameter (not required) with default value

jjb.sh:
- Changing PS4 for more indicative debug prompt
- Adding flags to get the repo and branch

jjb-deploy.yaml:
- Calling the jjb.sh with the correct flags

Signed-off-by: liranmauda <liran.mauda@gmail.com>
This commit is contained in:
liranmauda
2020-11-01 13:31:05 +02:00
committed by mergify[bot]
parent 1700f8585c
commit c281511a11
5 changed files with 99 additions and 29 deletions

View File

@ -3,6 +3,15 @@
name: jjb-deploy
project-type: pipeline
concurrent: false
parameters:
- string:
name: GIT_REPO
default: http://github.com/ceph/ceph-csi
description: The git repo url
- string:
name: GIT_BRANCH
default: ci/centos
description: The git branch
properties:
- github:
url: https://github.com/ceph/ceph-csi
@ -10,22 +19,21 @@
days-to-keep: 7
artifact-days-to-keep: 7
dsl: |
def GIT_REPO = 'http://github.com/ceph/ceph-csi'
def GIT_BRANCH = 'ci/centos'
node {
stage('checkout ci repository') {
git url: "${GIT_REPO}", branch: "${GIT_BRANCH}", changelog: false
}
stage('deployment') {
sh './deploy/jjb.sh deploy'
sh "./deploy/jjb.sh --cmd deploy \
--GIT_REF ${GIT_BRANCH} --GIT_REPO ${GIT_REPO}"
}
}
scm:
- git:
name: origin
url: https://github.com/ceph/ceph-csi
url: $GIT_REPO
branches:
- ci/centos
- $GIT_BRANCH
triggers:
- pollscm:
cron: "H/5 * * * *"

View File

@ -3,6 +3,15 @@
name: jjb-validate
project-type: pipeline
concurrent: false
parameters:
- string:
name: GIT_REPO
default: http://github.com/ceph/ceph-csi
description: The git repo url
- string:
name: GIT_BRANCH
default: ci/centos
description: The git branch
properties:
- github:
url: https://github.com/ceph/ceph-csi
@ -10,9 +19,6 @@
days-to-keep: 7
artifact-days-to-keep: 7
dsl: |
def GIT_REPO = 'https://github.com/ceph/ceph-csi'
def GIT_BRANCH = 'ci/centos'
if (params.ghprbPullId != null) {
GIT_BRANCH = "pull/${ghprbPullId}/merge"
}
@ -24,13 +30,14 @@
refspec: "${GIT_BRANCH}"]]])
}
stage('validation') {
sh "GIT_REF=${GIT_BRANCH} ./deploy/jjb.sh validate"
sh "./deploy/jjb.sh --cmd validate \
--GIT_REF ${GIT_BRANCH} --GIT_REPO ${GIT_REPO}"
}
}
triggers:
- github-pull-request:
status-context: ci/centos/jjb-validate
trigger-phrase: '/(re)?test ((all)|(ci/centos/jjb-validate))'
trigger-phrase: "/(re)?test ((all)|(ci/centos/jjb-validate))"
permit-all: true
github-hooks: true
white-list-target-branches: