This is an automated email from the ASF dual-hosted git repository. skygo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/netbeans-jenkins-lib.git
The following commit(s) were added to refs/heads/master by this push: new 326c22b add some basic steps for apidoc and test json and curl 326c22b is described below commit 326c22b5e671576cf10c19a4c8e7c7f36aa627f7 Author: Eric Barboni <sk...@apache.org> AuthorDate: Fri May 17 15:00:10 2019 +0200 add some basic steps for apidoc and test json and curl --- vars/asfMainNetBeansBuild.groovy | 61 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 6 deletions(-) diff --git a/vars/asfMainNetBeansBuild.groovy b/vars/asfMainNetBeansBuild.groovy index 31fdb32..8666db6 100644 --- a/vars/asfMainNetBeansBuild.groovy +++ b/vars/asfMainNetBeansBuild.groovy @@ -21,16 +21,59 @@ // this script is taken from olamy works on archiva-jenkins-lib for the Apache Archiva project def call(Map params = [:]) { - - +// variable needed for apidoc + def myAnt = "" + def apidocurl = "" + def date = "" + def atomdate = "" + pipeline { - agent any + options { + buildDiscarder(logRotator(numToKeepStr: '1')) + disableConcurrentBuilds() + } + agent { node { label 'ubuntu' } } stages{ stage("Test"){ agent { node { label 'ubuntu' } } - options { timeout(time: 120, unit: 'MINUTES') } + options { timeout(time: 180, unit: 'MINUTES') } steps{ - echo env.BRANCH_NAME; + script { + // test if we can do that + sh 'curl https://netbeans.apache.org/community/index.html -o test.html' + echo "curl over" + // write a custom json with valid data + writeFile(file: 'test.json', text: '{ "release90": { "ant": "Ant (latest)", "jdk": "JDK 1.8 (latest)", "maven": "Maven 3.3.9", "releaseDate": "29 Jul 2018", "atomreleaseDate": "2018-07-29T12:00:00Z", "tlp": "false", "apidocurl": "https://bits.netbeans.org/9.0/javadoc" }, "release100": { "ant": "Ant (latest)", "jdk": "JDK 1.8 (latest)", "maven": "Maven 3.3.9", [...] + echo "write over" + + def foo = readJSON file: 'test.json' + echo "readjs over" + + sh 'rm -f test.json' + echo "remove over" + myAnt = foo[env.BRANCH_NAME].ant; + apidocurl = foo[env.BRANCH_NAME].apidocurl + date = foo[env.BRANCH_NAME].releaseDate + atomdate = foo[env.BRANCH_NAME].atomreleaseDate + echo "echo over" + } + } + } + stage ("Apidoc") { + steps { + withAnt(installation: myAnt) { + script { + sh 'ant' + if (env.BRANCH_NAME=="master") { + sh "ant build-javadoc -Djavadoc.web.zip=${env.WORKSPACE}/WEBZIP.zip" + } else { + sh "ant build-javadoc -Djavadoc.web.root='${apidocurl}' -Dmodules-javadoc-date='${date}' -Datom-date='${atomdate}' -Djavadoc.web.zip=${env.WORKSPACE}/WEBZIP.zip" + } + } + + } + archiveArtifacts 'WEBZIP.zip' + } } } @@ -38,7 +81,13 @@ def call(Map params = [:]) { cleanup { cleanWs() // deleteDirs: true, notFailBuild: true, patterns: [[pattern: '**/.repository/**', type: 'INCLUDE']] } - + success { + slackSend (channel:'#netbeans-builds', message:"SUCCESS: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL}) ",color:'#00FF00') + } + failure { + slackSend (channel:'#netbeans-builds', message:"FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})",color:'#FF0000') + } + } } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists