--- /dev/null
+platforms = ["centos7", "debian9", "ubuntu16", "ubuntu18"]
+
+def buildClosures(arg) {
+ println arg.inspect()
+ def platforms = arg
+ def closures = [:]
+ for (value in platforms) {
+ //final valueCopy = value
+
+ closures[value] = {platform ->
+ stage("build-${platform}") {
+ docker.build("${platform}-master-test","-f ./scripts/docker/build-${platform}/Dockerfile.deps ./scripts/docker/build-${platform}").inside {
+ checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout'],[$class: 'RelativeTargetDirectory', relativeTargetDir: "${platform}/build"]], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/mattrose/freeradius-server']]])
+ sh "cat /etc/os-release || cat /etc/redhat-release"
+ dir("${platform}/build") {
+ if (platform.contains("centos")) {
+ sh 'QA_RPATHS=0x0003 RADIUSD_VERSION_STRING=$(cat VERSION) make rpm'
+ sh "mv rpmbuild/RPMS/x86_64/*.rpm .."
+ } else {
+ sh "apt-get install -y unixodbc-dev"
+ sh label: '', script: '''version=$(dpkg-parsechangelog | grep "^Version: " | awk \'{print $2}\')
+ commit_msg="$(git log --oneline -1 $GIT_COMMIT)"
+ dch -b -v ${version}-${BUILD_NUMBER} "$commit_msg"'''
+ sh "make deb"
+ }
+ }
+ }
+ }
+ echo platform.toString()
+ }.curry(value)
+ }
+ closures
+}
+
+node {
+ checkout scm
+ sh "echo $BUILD_NUMBER > build-number"
+ parallel buildClosures(platforms)
+ archiveArtifacts artifacts: 'build-number , **/*.deb , **/*.changes , **/*.rpm', onlyIfSuccessful: true
+ cleanWs()
+}
--- /dev/null
+### Jenkins scripted build pipeline for FreeRADIUS
+
+The files in this directory are meant to be run by
+[Jenkins](https://jenkins.io/) and make use of [the docker
+plugin](https://plugins.jenkins.io/docker-workflow) to build freeradius
+packages for multiple different linux distributions in parallel. To run this
+file in Jenkins you can just add a new pipeline job and point it at
+`scripts/jenkins/Jenkinsfile`