[commit: ghc] wip/jenkins: Move to scripted pipeline (fb0854f)

git at git.haskell.org git at git.haskell.org
Thu May 18 01:08:50 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/jenkins
Link       : http://ghc.haskell.org/trac/ghc/changeset/fb0854f2fe06d0243dd55cde5ee99dc528f60e44/ghc

>---------------------------------------------------------------

commit fb0854f2fe06d0243dd55cde5ee99dc528f60e44
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Wed May 17 20:52:58 2017 -0400

    Move to scripted pipeline


>---------------------------------------------------------------

fb0854f2fe06d0243dd55cde5ee99dc528f60e44
 Jenkinsfile | 56 ++++++++++++++++++++++++++------------------------------
 1 file changed, 26 insertions(+), 30 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 24c2949..184e94a 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,5 +1,17 @@
+#!groovy
+
+properties(
+  [
+    parameters(
+      [
+        booleanParam(name: 'build_docs', defaultValue: false, description: 'build and upload documentation'),
+        string(name: 'threads', defaultValue: '2', description: 'available parallelism'),
+        booleanParam(name: 'nightly', defaultValue: false, description: 'are we building a nightly?')
+      ])
+  ])
+
 def buildGhc() {
-  steps {
+  stage('Build') {
     sh 'git submodule update --init --recursive'
     def speed = 'NORMAL'
     if (params.nightly) {
@@ -18,38 +30,22 @@ def buildGhc() {
         make THREADS=${params.threads} test
         '''
   }
-}
-
-pipeline {
-  agent any
-  parameters {
-    booleanParam(name: 'build_docs', defaultValue: false, description: 'build and upload documentation')
-    string(name: 'threads', defaultValue: '2', description: 'available parallelism')
-    booleanParam(name: 'nightly', defaultValue: false, description: 'are we building a nightly?')
-  }
-
-  stages {
-    stage('Build') {
-      steps {
-        buildGhc()
-      }
-    }
 
-    stage('Install testsuite dependencies') {
-      when { environment expression { return params.nightly } }
-      steps {
-        sh 'cabal install --with-compiler=`pwd`/inplace/bin/ghc-stage2 --package-db=`pwd`/inplace/lib/package.conf.d mtl parallel parsec primitive QuickCheck random regex-compat syb stm utf8-string vector'
-      }
+  stage('Install testsuite dependencies') {
+    if (params.nightly) {
+      sh 'cabal install --with-compiler=`pwd`/inplace/bin/ghc-stage2 --package-db=`pwd`/inplace/lib/package.conf.d mtl parallel parsec primitive QuickCheck random regex-compat syb stm utf8-string vector'
     }
+  }
 
-    stage('Normal testsuite run') {
-      def target = 'test'
-      if (params.nightly) {
-        target = 'slowtest'
-      }
-      steps {
-        sh 'make THREADS=${params.threads} ${target}'
-      }
+  stage('Normal testsuite run') {
+    def target = 'test'
+    if (params.nightly) {
+      target = 'slowtest'
     }
+    sh 'make THREADS=${params.threads} ${target}'
   }
 }
+
+node {
+  buildGhc()
+}



More information about the ghc-commits mailing list