added parameter to choose device config file in Jenkinsfile
This commit is contained in:
parent
36efe9aaf6
commit
174896c986
19
Jenkinsfile
vendored
19
Jenkinsfile
vendored
@ -24,6 +24,7 @@ core_count_str = '$((`nproc` + 1))'
|
|||||||
statusCode = 0
|
statusCode = 0
|
||||||
mail_body = "<h1>${JOB_NAME} - Build # ${BUILD_NUMBER} - ${currentBuild.currentResult}:</h1>"
|
mail_body = "<h1>${JOB_NAME} - Build # ${BUILD_NUMBER} - ${currentBuild.currentResult}:</h1>"
|
||||||
mail_subject = "${JOB_NAME} - Build # ${BUILD_NUMBER} - ${currentBuild.currentResult}!"
|
mail_subject = "${JOB_NAME} - Build # ${BUILD_NUMBER} - ${currentBuild.currentResult}!"
|
||||||
|
device_conf = ''
|
||||||
|
|
||||||
if(params.DEBUG)
|
if(params.DEBUG)
|
||||||
{
|
{
|
||||||
@ -73,6 +74,10 @@ if(params.BUILD_NODE)
|
|||||||
{
|
{
|
||||||
build_node = params.BUILD_NODE
|
build_node = params.BUILD_NODE
|
||||||
}
|
}
|
||||||
|
if(params.DEViCE_CONF)
|
||||||
|
{
|
||||||
|
device_conf = params.DEVICE_CONF
|
||||||
|
}
|
||||||
|
|
||||||
def printDebug(msg)
|
def printDebug(msg)
|
||||||
{
|
{
|
||||||
@ -149,6 +154,13 @@ def pre_build()
|
|||||||
{
|
{
|
||||||
stage('pre-build')
|
stage('pre-build')
|
||||||
{
|
{
|
||||||
|
script = 'test -f ' + config_path + '/' + device_conf + ' && echo true'
|
||||||
|
printDebug(script)
|
||||||
|
stdout = sh label: 'check for config file', script: script, returnStdout: true
|
||||||
|
if(!stdout.trim().equalsIgnoreCase('true'))
|
||||||
|
{
|
||||||
|
throw new Exception('Error: ' + device_conf + ' not found')
|
||||||
|
}
|
||||||
script = 'cd ' + git_folder + '; patch -p1 < ../' + patch
|
script = 'cd ' + git_folder + '; patch -p1 < ../' + patch
|
||||||
printDebug(script)
|
printDebug(script)
|
||||||
statusCode = sh label: 'patch_sources', script: script, returnStatus:true
|
statusCode = sh label: 'patch_sources', script: script, returnStatus:true
|
||||||
@ -177,7 +189,7 @@ def build()
|
|||||||
{
|
{
|
||||||
stage('build')
|
stage('build')
|
||||||
{
|
{
|
||||||
script = 'cp ' + config_path + 'tl_wr841_config ' + git_folder + '/.config'
|
script = 'cp ' + config_path + '/' + device_conf + ' ' + git_folder + '/.config'
|
||||||
printDebug(script)
|
printDebug(script)
|
||||||
sh label: 'copy_config', script: script
|
sh label: 'copy_config', script: script
|
||||||
if(statusCode != 0)
|
if(statusCode != 0)
|
||||||
@ -230,6 +242,11 @@ def post_build()
|
|||||||
job.save()
|
job.save()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def file_present(String[] file)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
def send_mail()
|
def send_mail()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user