You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2018/02/22 11:25:40 UTC

[incubator-plc4x] branch feature/Jenkinsfile_update created (now cea2e41)

This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a change to branch feature/Jenkinsfile_update
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git.


      at cea2e41  migrate to declarative jenkins pipeline

This branch includes the following new commits:

     new cea2e41  migrate to declarative jenkins pipeline

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
sruehl@apache.org.

[incubator-plc4x] 01/01: migrate to declarative jenkins pipeline

Posted by sr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch feature/Jenkinsfile_update
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git

commit cea2e41a60dd1cc3505ec687b5af9a81392badbb
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Thu Feb 22 12:25:36 2018 +0100

    migrate to declarative jenkins pipeline
---
 Jenkinsfile | 92 +++++++++++++++++++++++++++++++++----------------------------
 1 file changed, 50 insertions(+), 42 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 9d02cc8..96b23fb 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -18,60 +18,68 @@
  *  limitations under the License.
  *
  */
-// TODO: migrate to declarative pipeline if possible (https://jenkins.io/doc/book/pipeline/jenkinsfile/)
-node('ubuntu && !H33') {
-
-    currentBuild.result = "SUCCESS"
-
-    echo 'Building Branch: ' + env.BRANCH_NAME
-
-    // Setup the required environment variables.
-    def mvnHome = "${tool 'Maven 3 (latest)'}"
-    env.JAVA_HOME="${tool 'JDK 1.8 (latest)'}"
-    env.PATH="${env.JAVA_HOME}/bin:${env.PATH}"
+pipeline {
+    agent {
+        node {
+            label 'ubuntu && !H33'
+        }
+    }
 
-    // Make sure the feature branches don't change the SNAPSHOTS in Nexus.
-    def mavenGoal = "install"
-    def mavenLocalRepo = ""
-    if(env.BRANCH_NAME == 'master') {
-        mavenGoal = "deploy sonar:sonar"
-    } else {
-        mavenLocalRepo = "-Dmaven.repo.local=.repository"
+    environment {
+        CC = 'clang'
+        MVN_HOME = "${tool 'Maven 3 (latest)'}"
+        JAVA_HOME = "${tool 'JDK 1.8 (latest)'}"
+        PATH = "${env.JAVA_HOME}/bin:${env.PATH}"
     }
 
-    try {
-        stage ('Cleanup') {
-            echo 'Cleaning up the workspace'
-            deleteDir()
+    stages {
+        stage('Initialization') {
+            steps {
+                echo 'Building Branch: ' + env.BRANCH_NAME
+            }
         }
 
-        stage ('Checkout') {
-            echo 'Checking out branch ' + env.BRANCH_NAME
-            checkout scm
+        stage('Example Build') {
+            steps {
+                sh 'mvn -B clean verify'
+            }
         }
 
-        stage ('Build') {
-            echo 'Building'
-            sh "${mvnHome}/bin/mvn -Pjenkins-build ${mavenLocalRepo} clean ${mavenGoal} site:site"
+        stage('Cleanup') {
+            steps {
+                echo 'Cleaning up the workspace'
+                deleteDir()
+            }
         }
 
-        stage ('Stage Site') {
-            echo 'Staging Site'
-            sh "${mvnHome}/bin/mvn -Pjenkins-build ${mavenLocalRepo} site:stage"
+        stage('Checkout') {
+            steps {
+                echo 'Checking out branch ' + env.BRANCH_NAME
+                checkout scm
+            }
         }
 
-    }
+        stage('Build') {
+            steps {
+                // Make sure the feature branches don't change the SNAPSHOTS in Nexus.
+                def mavenGoal = "install"
+                def mavenLocalRepo = ""
+                if (env.BRANCH_NAME == 'master') {
+                    mavenGoal = "deploy sonar:sonar"
+                } else {
+                    mavenLocalRepo = "-Dmaven.repo.local=.repository"
+                }
+                echo 'Building'
+                sh "${MVN_HOME}/bin/mvn -Pjenkins-build ${mavenLocalRepo} clean ${mavenGoal} site:site"
+            }
+        }
 
+        stage('Stage Site') {
+            steps {
+                echo 'Staging Site'
+                sh "${MVN_HOME}/bin/mvn -Pjenkins-build ${mavenLocalRepo} site:stage"
+            }
+        }
 
-    catch (err) {
-        currentBuild.result = "FAILURE"
-/*            mail body: "project build error is here: ${env.BUILD_URL}" ,
-            from: 'xxxx@yyyy.com',
-            replyTo: 'dev@plc4x.apache.org',
-            subject: 'Autobuild for Branch ' env.BRANCH_NAME
-            to: 'commits@plc4x.apache.org'
-*/
-        throw err
     }
-
 }
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
sruehl@apache.org.