From 2274f5b94aec280310548ccf9e0801678261c2c7 Mon Sep 17 00:00:00 2001 From: psycho Date: Tue, 11 Aug 2020 20:26:29 +0200 Subject: [PATCH] testing_01 testing_01 --- Jenkinsfile | 68 +++++++++++++++++++++--- {TP-Link => configs}/TL-WR841/v11_config | 0 {TP-Link => configs}/TL-WR841/v12_config | 0 {TP-Link/TL-WR841 => patches}/16M.patch | 0 4 files changed, 62 insertions(+), 6 deletions(-) rename {TP-Link => configs}/TL-WR841/v11_config (100%) rename {TP-Link => configs}/TL-WR841/v12_config (100%) rename {TP-Link/TL-WR841 => patches}/16M.patch (100%) diff --git a/Jenkinsfile b/Jenkinsfile index 13e73d5..48edee1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,14 +1,70 @@ -void printDebug(msg) +import groovy.io.* + +def debug = false +def stageName = '' +def git_link +def config_path = '' + + +if(params.DEBUG) +{ + debug = true +} +if(params.GIT) +{ + git_link = params.GIT +} +if(params.CFG_PATH) +{ + config_path = params.CFG_PATH +} + +def listfiles(dir) { + dlist = [] + flist = [] + new File(dir).eachDir {dlist << it.name } + dlist.sort() + new File(dir).eachFile(FileType.FILES, {flist << it.name }) + flist.sort() + return (dlist << flist).flatten() +} + +def printDebug(msg) { println 'DEBUG: ' + msg } node('test') { - printDebug(pwd()) + if(debug) + { + printDebug('FFUUCCKK') + } + + fs = listfiles(config_path) + fs.each + { + println it + } + + stageName = 'checkout' + stage(stageName) + { + sh label: 'checkout_git', script: 'git clone ' + git_link + ' openwrt; cd openwrt' + } + + stageName = 'pre-build' + stage(stageName) + { + sh label: 'patch_sources', script: 'patch -p1 < ../owrt_build_script/patches/16M.patch' + sh label: 'feeds_update', script: './scripts/feeds update -a' + sh label: 'feeds_install', script: './scripts/feeds install -a' + + } - stage('test') - { - sh label: 'script_label', script: 'cd openwrt; echo fuck you' - } + stageName = 'build' + stage(stageName) + { + sh label: 'build', script: 'echo fuck you' + } } diff --git a/TP-Link/TL-WR841/v11_config b/configs/TL-WR841/v11_config similarity index 100% rename from TP-Link/TL-WR841/v11_config rename to configs/TL-WR841/v11_config diff --git a/TP-Link/TL-WR841/v12_config b/configs/TL-WR841/v12_config similarity index 100% rename from TP-Link/TL-WR841/v12_config rename to configs/TL-WR841/v12_config diff --git a/TP-Link/TL-WR841/16M.patch b/patches/16M.patch similarity index 100% rename from TP-Link/TL-WR841/16M.patch rename to patches/16M.patch