diff --git a/Jenkinsfile b/Jenkinsfile
index b554caa..d2ebf73 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -24,6 +24,7 @@ core_count_str = '$((`nproc` + 1))'
statusCode = 0
mail_body = "
${JOB_NAME} - Build # ${BUILD_NUMBER} - ${currentBuild.currentResult}:
"
mail_subject = "${JOB_NAME} - Build # ${BUILD_NUMBER} - ${currentBuild.currentResult}!"
+device_conf = ''
if(params.DEBUG)
{
@@ -73,6 +74,10 @@ if(params.BUILD_NODE)
{
build_node = params.BUILD_NODE
}
+if(params.DEViCE_CONF)
+{
+ device_conf = params.DEVICE_CONF
+}
def printDebug(msg)
{
@@ -149,6 +154,13 @@ def 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
printDebug(script)
statusCode = sh label: 'patch_sources', script: script, returnStatus:true
@@ -177,7 +189,7 @@ def build()
{
stage('build')
{
- script = 'cp ' + config_path + 'tl_wr841_config ' + git_folder + '/.config'
+ script = 'cp ' + config_path + '/' + device_conf + ' ' + git_folder + '/.config'
printDebug(script)
sh label: 'copy_config', script: script
if(statusCode != 0)
@@ -230,6 +242,11 @@ def post_build()
job.save()
}
}
+
+def file_present(String[] file)
+{
+
+}
def send_mail()
{