| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 | #!groovy// StarPU --- Runtime system for heterogeneous multicore architectures.//// Copyright (C) 2018-2020  Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria//// StarPU is free software; you can redistribute it and/or modify// it under the terms of the GNU Lesser General Public License as published by// the Free Software Foundation; either version 2.1 of the License, or (at// your option) any later version.//// StarPU is distributed in the hope that it will be useful, but// WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.//// See the GNU Lesser General Public License in COPYING.LGPL for more details.//def statusHasChanged = falsepipeline{	agent none	// Trigger the build	triggers	{		// Poll scm once a day between 10pm and 11pm		pollSCM('H 22 * * *')	}	stages	{		stage('Tarball')		{			steps			{				node('autotools')				{					checkout scm					sh 'contrib/ci.inria.fr/job-0-tarball.sh'					script					{					       env.tarballgz = sh (script: 'ls *.tar.gz', returnStdout: true).trim()					}					stash includes: "${env.tarballgz}", name: 'tarballgz'					stash includes: "starpu.pdf", name: 'doc'					stash includes: "starpu_dev.pdf", name: 'doc_dev'					// Stash those scripts because they are not in make dist					dir('contrib/ci.inria.fr')					{						stash includes: "job-1-check-windows.bat", name: 'script-windows-check'						stash includes: "job-1-build-windows.sh", name: 'script-windows-build'					}					archiveArtifacts artifacts: "${env.tarballgz},starpu.pdf,starpu_dev.pdf", fingerprint: true, onlyIfSuccessful: true					deleteDir()				}			}		}		stage('Check')		{			steps			{				script				{					labelToSelect = 'windows'					listOfNodeNames = jenkins.model.Jenkins.instance.nodes.collect					{						node -> node.getLabelString().contains(labelToSelect) ? node.name : null					}					listOfNodeNames.removeAll(Collections.singleton(null))					def p = listOfNodeNames.collectEntries					{						[ (it):						{							node(it)							{								dir('check-windows')								{									unstash 'tarballgz'									unstash 'script-windows-check'									unstash 'script-windows-build'									bat './job-1-check-windows.bat'									archiveArtifacts artifacts: "*.zip", fingerprint: true, onlyIfSuccessful: true									if (env.KEEP_WORKING_DIRECTORY != 'true')										deleteDir()								}							}						}					]}					parallel p;				}			}		}	}	post	{		// hooks are called in order: always, changed, aborted, failure, success, unstable		changed		{			echo "Build status has changed."			script			{				statusHasChanged = true			}		}		success		{			echo "Build success."			// email when changed to success			script			{				if (statusHasChanged)				{					emailext(body: '${DEFAULT_CONTENT}',						 subject: '${DEFAULT_SUBJECT}',						 replyTo: '$DEFAULT_REPLYTO',						 to: '$DEFAULT_RECIPIENTS')				}			}		}		failure		{			echo "Build failure."			// always email on failure			emailext(body: '${DEFAULT_CONTENT}',				 subject: '${DEFAULT_SUBJECT}',				 replyTo: '$DEFAULT_REPLYTO',				 to: '$DEFAULT_RECIPIENTS')		}	}}
 |