Merge pull request #34 from ebarboni/matrux
Feed matrix job
diff --git a/jobs/Jenkinsmatrixfile.groovy b/jobs/Jenkinsmatrixfile.groovy
new file mode 100644
index 0000000..d93ca6c
--- /dev/null
+++ b/jobs/Jenkinsmatrixfile.groovy
@@ -0,0 +1,69 @@
+pipeline {
+ options {
+ buildDiscarder(logRotator(numToKeepStr: '2'))
+ disableConcurrentBuilds()
+ }
+ agent { node { label 'ubuntu' } }
+
+ stages {
+
+ stage("clone and prepare build") {
+ tools {
+ jdk 'jdk_1.8_latest'
+ ant 'ant_latest'
+ }
+ steps {
+
+
+ git 'https://github.com/apache/netbeans'
+ sh 'rm -f *.json* '
+ sh 'rm -f nbbuild/*.zip'
+ sh 'wget -Onetbeansrelease.json "https://gitbox.apache.org/repos/asf?p=netbeans-jenkins-lib.git;a=blob_plain;f=meta/netbeansrelease.json" '
+ sh 'ant build -Dmetabuild.jsonurl=file:netbeansrelease.json'
+ sh 'ant build-test-dist -Dmetabuild.jsonurl=file:netbeansrelease.json'
+ stash includes: 'nbbuild/build/testdist.zip', name: 'testbuildzip'
+ sh 'mv nbbuild/NetBeans*.zip nbbuild/NetBeansIDE.zip '
+ stash includes: 'nbbuild/NetBeansIDE.zip', name: 'idebuildzip'
+ }
+ }
+ stage ("EffectiveMatrix")
+ {
+ matrix {
+ agent { node { label 'ubuntu' } }
+
+ axes {
+ axis {
+ name 'JDK'
+ values 'jdk_1.8_latest', 'jdk_11_latest', 'jdk_17_latest'
+ }
+ axis {
+ name 'MODULE'
+ values 'platform', 'ide'
+ }
+ }
+ stages {
+ stage('test') {
+ tools {
+ ant 'ant_latest'
+ }
+ steps {
+ withAnt(jdk:"${env.JDK}") {
+ unstash 'testbuildzip'
+ unstash 'idebuildzip'
+ unzip zipFile: 'nbbuild/build/testdist.zip', dir:'testdir'
+ unzip zipFile: 'nbbuild/NetBeansIDE.zip', dir:'netbeans'
+ sh 'java -version'
+ sh 'ant -version'
+ // this is not good
+ sh 'ant -f testdist/unit/unit-all-unit.xml runtests -Dnetbeans.dest.dir=./netbeans'
+
+ }
+ }
+
+ }
+ }}
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/jobs/netbeanstestmatrix.groovy b/jobs/netbeanstestmatrix.groovy
new file mode 100644
index 0000000..6677374
--- /dev/null
+++ b/jobs/netbeanstestmatrix.groovy
@@ -0,0 +1,36 @@
+#!groovy
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+pipelineJob('NetBeans/netbeans-matrix') {
+ definition {
+ cps {
+
+ script(readFileFromWorkspace('Jenkinsmatrixfile.groovy'))
+ }
+ }
+}
+
+
+listView('NetBeans/netbeans') {
+ jobs {
+ name('NetBeans/netbeans-matrix')
+ }
+}