Jenkinsfile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #!/usr/bin/env groovy
  2. node('master') {
  3. def changelog = getChangeLog currentBuild
  4. slackSend "Building ${env.JOB_NAME} #${env.BUILD_NUMBER} \n Change Log: \n ${changelog}"
  5. }
  6. parallel 'centos7': {
  7. node('centos7') {
  8. try {
  9. checkout scm
  10. stage('Build Centos 7') {
  11. sh 'make -f make-linux.mk'
  12. }
  13. }
  14. catch (err) {
  15. currentBuild.result = "FAILURE"
  16. slackSend color: '#ff0000', message: "${env.JOB_NAME} broken on Centos 7 (<${env.BUILD_URL}|Open>)"
  17. throw err
  18. }
  19. }
  20. }, 'android-ndk': {
  21. node('android-ndk') {
  22. try {
  23. checkout scm
  24. stage('Build Android NDK') {
  25. sh "/android/android-ndk-r13b/ndk-build -C $WORKSPACE/java ZT1=${WORKSPACE}"
  26. }
  27. }
  28. catch (err) {
  29. currentBuild.result = "FAILURE"
  30. slackSend color: '#ff0000', message: "${env.JOB_NAME} broken on Android NDK (<${env.BUILD_URL}|Open>)"
  31. throw err
  32. }
  33. }
  34. }, 'macOS': {
  35. node('macOS') {
  36. try {
  37. checkout scm
  38. stage('Build macOS') {
  39. sh 'make -f make-mac.mk'
  40. }
  41. stage('Build macOS UI') {
  42. sh 'cd macui && xcodebuild -target "ZeroTier One" -configuration Debug'
  43. }
  44. }
  45. catch (err) {
  46. currentBuild.result = "FAILURE"
  47. slackSend color: '#ff0000', message: "${env.JOB_NAME} broken on macOS (<${env.BUILD_URL}|Open>)"
  48. throw err
  49. }
  50. }
  51. }, 'windows': {
  52. node('windows') {
  53. try {
  54. checkout scm
  55. stage('Build Windows') {
  56. bat '''CALL "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat" amd64
  57. git clean -dfx
  58. msbuild windows\\ZeroTierOne.sln
  59. '''
  60. }
  61. }
  62. catch (err) {
  63. currentBuild.result = "FAILURE"
  64. slackSend color: '#ff0000', message: "${env.JOB_NAME} broken on Windows (<${env.BUILD_URL}|Open>)"
  65. throw err
  66. }
  67. }
  68. }
  69. slackSend color: "#00ff00", message: "${env.JOB_NAME} #${env.BUILD_NUMBER} Complete (<${env.BUILD_URL}|Show More...>)"