forked from ome/omero-gradle-plugins
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile.merge
51 lines (46 loc) · 1.78 KB
/
Jenkinsfile.merge
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
pipeline {
agent {
label 'testintegration'
}
parameters {
choice(
name: 'STATUS',
choices: ['success-only', 'no-error', 'none'],
description: 'PR check status'
)
string(
name: 'MERGE_OPTIONS',
defaultValue: '-vvv --no-ask --reset --comment',
description: 'scc merge options'
)
}
environment {
// These optional environment variables can be set in
// Manage Jenkins → Configure System → Global properties → Environment variables
// MERGE_PUSH_BRANCH the branch that merges should be pushed to, default "merge"
// MERGE_GIT_USER the GitHub user that the repo branches should be pushed to
// default is the owner of the CI node's GitHub token
BASE_REPO = 'omero-gradle-plugins.git'
}
stages {
stage('Merge') {
steps {
// build is in .gitignore so we can use it as a temp dir
sh 'mkdir build'
sh 'cd build && curl -sfL https://github.com/ome/build-infra/archive/master.tar.gz | tar -zxf -'
sh 'virtualenv build/venv && build/venv/bin/pip install scc'
sh """
. build/venv/bin/activate
if [ "${env.MERGE_PUSH_BRANCH}" != "null" ]; then
export PUSH_BRANCH=${env.MERGE_PUSH_BRANCH}
fi
if [ "${env.MERGE_GIT_USER}" != "null" ]; then
export GIT_USER=${env.MERGE_GIT_USER}
fi
export STATUS=${params.STATUS} MERGE_OPTIONS="${params.MERGE_OPTIONS}"
bash build/build-infra-master/recursive-merge
"""
}
}
}
}