You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2019/01/10 08:48:46 UTC

[GitHub] ebarboni closed pull request #9: build file for apidoc and maven artefacts

ebarboni closed pull request #9: build file for apidoc and maven artefacts
URL: https://github.com/apache/incubator-netbeans-tools/pull/9
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/buildscripts/conveniences/Jenkinsfile-master.groovy b/buildscripts/conveniences/Jenkinsfile-master.groovy
new file mode 100644
index 0000000..b8397c0
--- /dev/null
+++ b/buildscripts/conveniences/Jenkinsfile-master.groovy
@@ -0,0 +1,65 @@
+pipeline {
+   agent  { label 'ubuntu' }
+   tools {
+      maven 'Maven 3.3.9'
+      jdk 'JDK 1.8 (latest)'
+   }
+   stages {
+      stage('Informations') {
+          steps {
+              echo "Branche we are building is : master"
+          }
+      }
+      stage('mavenutils preparation') {
+          // this stage is temporary
+          steps {
+              echo 'Get Mavenutils sources'
+              sh 'rm -rf mavenutils'
+              checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', noTags: true, reference: '', shallow: true], [$class: 'MessageExclusion', excludedMessage: 'Automated site publishing.*'], [$class: 'RelativeTargetDirectory', relativeTargetDir: 'mavenutils']], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/apache/incubator-netbeans-mavenutils/']]])
+              script {
+                 def mvnfoldersforsite  = ['parent','nbm-shared','nb-repository-plugin']
+                 for (String mvnproject in mvnfoldersforsite) {
+                     dir('mavenutils/'+mvnproject) {
+                        sh "mvn clean install -Dmaven.repo.local=${env.WORKSPACE}/.repository"
+                     }
+                 }
+              }
+          }
+      }
+      stage('SCM operation') {
+          steps {
+              echo 'clean up netbeans sources'
+              sh 'rm -rf netbeanssources'
+              echo 'Get NetBeans sources'
+              checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', noTags: true, reference: '', shallow: true], [$class: 'MessageExclusion', excludedMessage: 'Automated site publishing.*'], [$class: 'RelativeTargetDirectory', relativeTargetDir: 'netbeanssources']], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/apache/incubator-netbeans/']]])
+          }
+      }
+      stage('NetBeans Builds') {
+          steps {
+              dir ('netbeanssources'){
+                  withAnt(installation: 'Ant (latest)') {
+                      sh 'ant'
+                      sh "ant build-javadoc -Djavadoc.web.zip=${env.WORKSPACE}/WEBZIP.zip"
+                      sh 'ant build-source-zips'
+                      sh 'ant build-nbms'
+                  }
+              }
+              archiveArtifacts 'WEBZIP.zip'
+              archiveArtifacts 'netbeanssources/nbbuild/netbeans/**'
+              archiveArtifacts 'netbeanssources/nbbuild/build/source-zips/**'
+              archiveArtifacts 'netbeanssources/nbbuild/build/javadoc/**'
+              archiveArtifacts 'netbeanssources/nbbuild/nbms/**'
+            }
+      }
+      stage('NetBeans Maven Stage') {
+          steps {
+              script {
+                        sh "mvn org.netbeans.maven:nb-repository-plugin:1.4-SNAPSHOT:download -DnexusIndexDirectory=${env.WORKSPACE}/repoindex -Dmaven.repo.local=${env.WORKSPACE}/.repository -DrepositoryUrl=https://repo.maven.apache.org/maven2"
+                        sh 'mkdir -p testrepo/.m2'
+                        sh "mvn org.netbeans.maven:nb-repository-plugin:1.4-SNAPSHOT:populate -DnexusIndexDirectory=${env.WORKSPACE}/repoindex -DnetbeansNbmDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/nbms -DnetbeansInstallDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/netbeans -DnetbeansSourcesDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/build/source-zips -DnebeansJavadocDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/build/javadoc  -Dmaven.repo.local=${env.WORKSPACE}/.repository -DforcedVersion=dev-SNAPSHOT -DskipInstall=true -DdeployUrl=file://${env.WORKSPACE}/testrepo/.m2"
+              }
+              archiveArtifacts 'testrepo/.m2/**'
+          }
+      }
+   }
+}
diff --git a/buildscripts/conveniences/Jenkinsfile-release100.groovy b/buildscripts/conveniences/Jenkinsfile-release100.groovy
new file mode 100644
index 0000000..4511229
--- /dev/null
+++ b/buildscripts/conveniences/Jenkinsfile-release100.groovy
@@ -0,0 +1,65 @@
+pipeline {
+   agent  { label 'ubuntu' }
+   tools {
+      maven 'Maven 3.3.9'
+      jdk 'JDK 1.8 (latest)'
+   }
+   stages {
+      stage('Informations') {
+          steps {
+              echo "Branche we are building is : release100"
+          }
+      }
+      stage('mavenutils preparation') {
+          // this stage is temporary
+          steps {
+              echo 'Get Mavenutils sources'
+              sh 'rm -rf mavenutils'
+              checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', noTags: true, reference: '', shallow: true], [$class: 'MessageExclusion', excludedMessage: 'Automated site publishing.*'], [$class: 'RelativeTargetDirectory', relativeTargetDir: 'mavenutils']], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/apache/incubator-netbeans-mavenutils/']]])
+              script {
+                 def mvnfoldersforsite  = ['parent','nbm-shared','nb-repository-plugin']
+                 for (String mvnproject in mvnfoldersforsite) {
+                     dir('mavenutils/'+mvnproject) {
+                        sh "mvn clean install -Dmaven.repo.local=${env.WORKSPACE}/.repository"
+                     }
+                 }
+              }
+          }
+      }
+      stage('SCM operation') {
+          steps {
+              echo 'clean up netbeans sources'
+              sh 'rm -rf netbeanssources'
+              echo 'Get NetBeans sources'
+              checkout([$class: 'GitSCM', branches: [[name: '*/release100']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', noTags: true, reference: '', shallow: true], [$class: 'MessageExclusion', excludedMessage: 'Automated site publishing.*'], [$class: 'RelativeTargetDirectory', relativeTargetDir: 'netbeanssources']], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/apache/incubator-netbeans/']]])
+          }
+      }
+      stage('NetBeans Builds') {
+          steps {
+              dir ('netbeanssources'){
+                  withAnt(installation: 'Ant (latest)') {
+                      sh 'ant'
+                      sh "ant build-javadoc -Djavadoc.web.root='RELEASE100' -Dmodules-javadoc-date='4 Dec 2018' -Datom-date='2018-12-04T12:00:00Z' -Djavadoc.web.zip=${env.WORKSPACE}/WEBZIP.zip"
+                      sh 'ant build-source-zips'
+                      sh 'ant build-nbms'
+                  }
+              }
+              archiveArtifacts 'WEBZIP.zip'
+              archiveArtifacts 'netbeanssources/nbbuild/netbeans/**'
+              archiveArtifacts 'netbeanssources/nbbuild/build/source-zips/**'
+              archiveArtifacts 'netbeanssources/nbbuild/build/javadoc/**'
+              archiveArtifacts 'netbeanssources/nbbuild/nbms/**'
+            }
+      }
+      stage('NetBeans Maven Stage') {
+          steps {
+              script {
+                        sh "mvn org.netbeans.maven:nb-repository-plugin:1.4-SNAPSHOT:download -DnexusIndexDirectory=${env.WORKSPACE}/repoindex -Dmaven.repo.local=${env.WORKSPACE}/.repository -DrepositoryUrl=https://repo.maven.apache.org/maven2"
+                        sh 'mkdir -p testrepo/.m2'
+                        sh "mvn org.netbeans.maven:nb-repository-plugin:1.4-SNAPSHOT:populate -DnexusIndexDirectory=${env.WORKSPACE}/repoindex -DnetbeansNbmDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/nbms -DnetbeansInstallDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/netbeans -DnetbeansSourcesDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/build/source-zips -DnebeansJavadocDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/build/javadoc  -Dmaven.repo.local=${env.WORKSPACE}/.repository -DforcedVersion=RELEASE100 -DskipInstall=true -DdeployUrl=file://${env.WORKSPACE}/testrepo/.m2"
+              }
+              archiveArtifacts 'testrepo/.m2/**'
+          }
+      }
+   }
+}
diff --git a/buildscripts/conveniences/Jenkinsfile-release90.groovy b/buildscripts/conveniences/Jenkinsfile-release90.groovy
new file mode 100644
index 0000000..299b834
--- /dev/null
+++ b/buildscripts/conveniences/Jenkinsfile-release90.groovy
@@ -0,0 +1,65 @@
+pipeline {
+   agent  { label 'ubuntu' }
+   tools {
+      maven 'Maven 3.3.9'
+      jdk 'JDK 1.8 (latest)'
+   }
+   stages {
+      stage('Informations') {
+          steps {
+              echo "Branche we are building is : release90"
+          }
+      }
+      stage('mavenutils preparation') {
+          // this stage is temporary
+          steps {
+              echo 'Get Mavenutils sources'
+              sh 'rm -rf mavenutils'
+              checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', noTags: true, reference: '', shallow: true], [$class: 'MessageExclusion', excludedMessage: 'Automated site publishing.*'], [$class: 'RelativeTargetDirectory', relativeTargetDir: 'mavenutils']], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/apache/incubator-netbeans-mavenutils/']]])
+              script {
+                 def mvnfoldersforsite  = ['parent','nbm-shared','nb-repository-plugin']
+                 for (String mvnproject in mvnfoldersforsite) {
+                     dir('mavenutils/'+mvnproject) {
+                        sh "mvn clean install -Dmaven.repo.local=${env.WORKSPACE}/.repository"
+                     }
+                 }
+              }
+          }
+      }
+      stage('SCM operation') {
+          steps {
+              echo 'clean up netbeans sources'
+              sh 'rm -rf netbeanssources'
+              echo 'Get NetBeans sources'
+              checkout([$class: 'GitSCM', branches: [[name: '*/release90']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', noTags: true, reference: '', shallow: true], [$class: 'MessageExclusion', excludedMessage: 'Automated site publishing.*'], [$class: 'RelativeTargetDirectory', relativeTargetDir: 'netbeanssources']], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/apache/incubator-netbeans/']]])
+          }
+      }
+      stage('NetBeans Builds') {
+          steps {
+              dir ('netbeanssources'){
+                  withAnt(installation: 'Ant (latest)') {
+                      sh 'ant'
+                      sh "ant build-javadoc -Djavadoc.web.root='RELEASE90' -Dmodules-javadoc-date='29 Jul 2018' -Datom-date='2018-07-29T12:00:00Z' -Djavadoc.web.zip=${env.WORKSPACE}/WEBZIP.zip"
+                      sh 'ant build-source-zips'
+                      sh 'ant build-nbms'
+                  }
+              }
+              archiveArtifacts 'WEBZIP.zip'
+              archiveArtifacts 'netbeanssources/nbbuild/netbeans/**'
+              archiveArtifacts 'netbeanssources/nbbuild/build/source-zips/**'
+              archiveArtifacts 'netbeanssources/nbbuild/build/javadoc/**'
+              archiveArtifacts 'netbeanssources/nbbuild/nbms/**'
+            }
+      }
+      stage('NetBeans Maven Stage') {
+          steps {
+              script {
+                        sh "mvn org.netbeans.maven:nb-repository-plugin:1.4-SNAPSHOT:download -DnexusIndexDirectory=${env.WORKSPACE}/repoindex -Dmaven.repo.local=${env.WORKSPACE}/.repository -DrepositoryUrl=https://repo.maven.apache.org/maven2"
+                        sh 'mkdir -p testrepo/.m2'
+                        sh "mvn org.netbeans.maven:nb-repository-plugin:1.4-SNAPSHOT:populate -DnexusIndexDirectory=${env.WORKSPACE}/repoindex -DnetbeansNbmDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/nbms -DnetbeansInstallDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/netbeans -DnetbeansSourcesDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/build/source-zips -DnebeansJavadocDirectory=${env.WORKSPACE}/netbeanssources/nbbuild/build/javadoc  -Dmaven.repo.local=${env.WORKSPACE}/.repository -DforcedVersion=RELEASE90 -DskipInstall=true -DdeployUrl=file://${env.WORKSPACE}/testrepo/.m2"
+              }
+              archiveArtifacts 'testrepo/.m2/**'
+          }
+      }
+   }
+}
diff --git a/buildscripts/conveniences/generatebuildscript.sh b/buildscripts/conveniences/generatebuildscript.sh
new file mode 100644
index 0000000..be06e62
--- /dev/null
+++ b/buildscripts/conveniences/generatebuildscript.sh
@@ -0,0 +1,127 @@
+#!/usr/bin/python
+
+##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.
+
+import locale
+from datetime import datetime
+
+## tools needed
+maven339='Maven 3.3.9'
+jdk8='JDK 1.8 (latest)'
+ant10='Ant (latest)'
+
+## information for each release (tools + date of release to flag the doc)
+## pick tools that are available on ubuntu node on build.apache.org
+releaseinfo=[
+['release90', True,jdk8,maven339,ant10,'1.4-SNAPSHOT','RELEASE90', 'http://bits.netbeans.org/9.0/javadoc', datetime(2018,07,29,12,00)],
+['release100',True,jdk8,maven339,ant10,'1.4-SNAPSHOT','RELEASE100','http://bits.netbeans.org/10.0/javadoc',datetime(2018,12, 4,12,00)],
+##release 111
+['master',True,jdk8,maven339,ant10,'1.4-SNAPSHOT','dev-SNAPSHOT']] ## no need custom info
+
+##for each release generate a 
+for arelease in releaseinfo:
+  branch=arelease[0]
+  jdktool=arelease[2]
+  maventool=arelease[3]
+  anttool=arelease[4]
+  tmpFile1 = open ('Jenkinsfile-'+branch+'.groovy',"w")
+  tmpFile1.write("pipeline {\n")
+  tmpFile1.write("   agent  { label 'ubuntu' }\n")
+  tmpFile1.write("   tools {\n")
+  tmpFile1.write("      maven '"+maventool+"'\n")
+  tmpFile1.write("      jdk '"+jdktool+"'\n") 
+  tmpFile1.write("   }\n")
+  tmpFile1.write("   stages {\n")
+  tmpFile1.write("      stage('Informations') {\n")
+  tmpFile1.write("          steps {\n")
+  tmpFile1.write("              echo "+'"'+'Branche we are building is : '+branch+'"'+"\n")
+  tmpFile1.write("          }\n")
+  tmpFile1.write("      }\n")
+## needed until we had mavenutil ready
+##prepare nb-repository from master to populate
+  if arelease[1] == True:
+     tmpFile1.write("      stage('mavenutils preparation') {\n")
+     tmpFile1.write("          // this stage is temporary\n")
+     tmpFile1.write("          steps {\n")
+     tmpFile1.write("              echo 'Get Mavenutils sources'\n")
+     tmpFile1.write("              sh 'rm -rf mavenutils'\n")
+     tmpFile1.write("              checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', noTags: true, reference: '', shallow: true], [$class: 'MessageExclusion', excludedMessage: 'Automated site publishing.*'], [$class: 'RelativeTargetDirectory', relativeTargetDir: 'mavenutils']], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/apache/incubator-netbeans-mavenutils/']]])\n")
+     tmpFile1.write("              script {\n")
+     tmpFile1.write("                 def mvnfoldersforsite  = ['parent','nbm-shared','nb-repository-plugin']\n");
+     tmpFile1.write("                 for (String mvnproject in mvnfoldersforsite) {\n")
+     tmpFile1.write("                     dir('mavenutils/'+mvnproject) {\n")
+     tmpFile1.write("                        sh "+'"'+'mvn clean install -Dmaven.repo.local=${env.WORKSPACE}/.repository'+'"'+"\n")
+     tmpFile1.write("                     }\n")
+     tmpFile1.write("                 }\n")
+     tmpFile1.write("              }\n")
+     tmpFile1.write("          }\n")
+     tmpFile1.write("      }\n")
+   
+  tmpFile1.write("      stage('SCM operation') {\n") 
+  tmpFile1.write("          steps {\n")
+  tmpFile1.write("              echo 'clean up netbeans sources'\n")
+  tmpFile1.write("              sh 'rm -rf netbeanssources'\n")
+  tmpFile1.write("              echo 'Get NetBeans sources'\n")
+  tmpFile1.write("              checkout([$class: 'GitSCM', branches: [[name: '*/"+branch+"']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', noTags: true, reference: '', shallow: true], [$class: 'MessageExclusion', excludedMessage: 'Automated site publishing.*'], [$class: 'RelativeTargetDirectory', relativeTargetDir: 'netbeanssources']], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/apache/incubator-netbeans/']]])\n") 
+  tmpFile1.write("          }\n")
+  tmpFile1.write("      }\n")
+## build netbeans all needed for javadoc and nb-repository plugin
+  tmpFile1.write("      stage('NetBeans Builds') {\n")
+  tmpFile1.write("          steps {\n")
+  tmpFile1.write("              dir ('netbeanssources'){\n")
+  tmpFile1.write("                  withAnt(installation: '"+anttool+"') {\n")
+  tmpFile1.write("                      sh 'ant'\n")
+## master use default parameter
+  if branch=='master':
+      tmpFile1.write("                      sh "+'"'+"ant build-javadoc -Djavadoc.web.zip=${env.WORKSPACE}/WEBZIP.zip"+'"'+"\n")
+  else:
+      locale.setlocale(locale.LC_ALL,"en_US.utf8")
+##URL for javadoc
+      javadocwebroot = arelease[6]
+##date for javadoc and for feed
+      javadocdate = arelease[8].strftime('%-d %b %Y')
+      atomdate = arelease[8].strftime('%Y-%m-%dT%H:%M:%SZ')
+      tmpFile1.write("                      sh "+'"'+"ant build-javadoc -Djavadoc.web.root='"+javadocwebroot+"' -Dmodules-javadoc-date='"+javadocdate+"' -Datom-date='"+atomdate+"' -Djavadoc.web.zip=${env.WORKSPACE}/WEBZIP.zip"+'"'+"\n")
+  tmpFile1.write("                      sh 'ant build-source-zips'\n")
+  tmpFile1.write("                      sh 'ant build-nbms'\n")
+  tmpFile1.write("                  }\n")
+  tmpFile1.write("              }\n")
+  tmpFile1.write("              archiveArtifacts 'WEBZIP.zip'\n")
+  tmpFile1.write("              archiveArtifacts 'netbeanssources/nbbuild/netbeans/**'\n")
+  tmpFile1.write("              archiveArtifacts 'netbeanssources/nbbuild/build/source-zips/**'\n")
+  tmpFile1.write("              archiveArtifacts 'netbeanssources/nbbuild/build/javadoc/**'\n")
+  tmpFile1.write("              archiveArtifacts 'netbeanssources/nbbuild/nbms/**'\n")
+  tmpFile1.write("            }\n")
+  tmpFile1.write("      }\n")
+#prepare maven artifacts
+  tmpFile1.write("      stage('NetBeans Maven Stage') {\n")
+  tmpFile1.write("          steps {\n")
+  tmpFile1.write("              script {\n")
+  nbbuildpath = "${env.WORKSPACE}/netbeanssources/nbbuild"
+  tmpFile1.write("                        sh "+'"'+'mvn org.netbeans.maven:nb-repository-plugin:'+arelease[5]+':download -DnexusIndexDirectory=${env.WORKSPACE}/repoindex -Dmaven.repo.local=${env.WORKSPACE}/.repository'+ ' -DrepositoryUrl=https://repo.maven.apache.org/maven2"'+"\n")
+  tmpFile1.write("                        sh 'mkdir -p testrepo/.m2'\n")
+  tmpFile1.write("                        sh "+'"'+'mvn org.netbeans.maven:nb-repository-plugin:'+arelease[5]+':populate -DnexusIndexDirectory=${env.WORKSPACE}/repoindex -DnetbeansNbmDirectory='+nbbuildpath+'/nbms -DnetbeansInstallDirectory='+nbbuildpath+'/netbeans -DnetbeansSourcesDirectory='+nbbuildpath+'/build/source-zips -DnebeansJavadocDirectory='+nbbuildpath+'/build/javadoc  -Dmaven.repo.local=${env.WORKSPACE}/.repository -DforcedVersion='+arelease[6]+' -DskipInstall=true -DdeployUrl=file://${env.WORKSPACE}/testrepo/.m2"'+"\n"
+)
+  tmpFile1.write("              }\n")
+  tmpFile1.write("              archiveArtifacts 'testrepo/.m2/**'\n")
+  tmpFile1.write("          }\n")
+  tmpFile1.write("      }\n")
+  tmpFile1.write("   }\n")
+  tmpFile1.write("}\n")
+  tmpFile1.close
+


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists