From c77e1d6beaa4c4782d99aaf0278d27fea29d18cd Mon Sep 17 00:00:00 2001 From: Lev Stipakov Date: Sat, 5 Aug 2017 13:38:14 +0300 Subject: [PATCH] Add pipeline script for multiplatform build. Builds Linux and Windows versions in parallel. Signed-off-by: Lev Stipakov --- Jenkinsfile | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..2586af87 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,44 @@ +def checkout() { + step([$class: 'WsCleanup']) + checkout([ + $class: 'GitSCM', + branches: [[name: '*/${BRANCH}']], + extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'core']], + userRemoteConfigs: [[credentialsId: 'jenkins', url: 'git@bitbucket.org:openvpntechnologies/ovpn3-core.git']] + ]) +} + +def build_linux() { + checkout() + withEnv(["O3=$WORKSPACE"]) { + dir("$O3/core/test/ovpncli") { + sh 'ECHO=1 PROF=linux ASIO_DIR=~/asio MTLS_SYS=1 LZ4_SYS=1 NOSSL=1 $O3/core/scripts/build cli' + } + } + archiveArtifacts 'core/test/ovpncli/cli' +} + +def build_windows() { + checkout() + dir('core\\win') { + bat 'copy c:\\Jenkins\\parms_local.py' + bat 'python buildep.py' + bat 'python build.py' + } + archiveArtifacts 'core/win/cli.exe,core/win/cli.obj' +} + +stage('Build') { + parallel( + linux: { + node('linux_slave') { + build_linux() + } + }, + windows: { + node('windows_slave') { + build_windows() + } + } + ) +}