Jenkinsfile 2.2 KB

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