Created
May 4, 2016 10:51
-
-
Save pumbaEO/5e0c3b91971a8b0a4c5fb9659c682d93 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job("utils") { | |
logRotator(-1, 4) | |
label("slave") | |
triggers { | |
cron('@daily') | |
} | |
scm { | |
git { | |
remote { | |
url("https://github.com/EvilBeaver/oscript-library.git") | |
branch("*/develop") | |
name('origin') | |
} | |
localBranch("develop") | |
relativeTargetDir("build/oscript/lib") | |
} | |
} | |
multiline='''mkdir -p build | |
if [ -f ./oscript.zip ]; then | |
rm ./oscript.zip | |
fi | |
wget --continue -O ./oscript.zip http://oscript.io/downloads/night-build/zip | |
unzip -o -q oscript.zip -x "lib/*" -d ./build/oscript | |
echo "\\nlib.system = ../lib/src" >> ./build/oscript/bin/oscript.cfg | |
''' | |
steps{ | |
dsl(''' | |
import jenkins.*; | |
import hudson.*; | |
import jenkins.model.*; | |
import hudson.model.*; | |
pm = Jenkins.instance.pluginManager | |
pm.doCheckUpdatesServer() | |
plugins = pm.plugins | |
plugins = Jenkins.instance.updateCenter.getUpdates() | |
def needRestart = false; | |
plugins.each { | |
println it.name; | |
Jenkins.instance.updateCenter.getPlugin(it.name).getNeededDependencies().each { | |
println " -->"+it.name; | |
it.deploy() | |
} | |
needRestart = true; | |
it.deploy() | |
} | |
if (Jenkins.instance.updateCenter.isRestartRequiredForCompletion() || needRestart) { | |
hudson.model.Hudson.instance.doSafeRestart(null) | |
} | |
''') | |
shell(multiline) | |
} | |
publishers { | |
archiveArtifacts('build/oscript/**') | |
} | |
} | |
//queue('utils') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment