Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. import groovy.sql.Sql
  2.  
  3. def db = "jenkins"
  4. def user = "jenkins_user"
  5. def pwd = "xxxxxxxx"
  6.  
  7. def sql = Sql.newInstance(
  8. "jdbc:mysql://localhost:3306/${db}",
  9. "${user}",
  10. "${pwd}",
  11. "com.mysql.jdbc.Driver"
  12. )
  13.  
  14. // Select all records from the emt table
  15. println "\n------------------------------Select All Email Master Template clones-------------------------------------\n"
  16. sql.eachRow("select * from emts") { printrow ->
  17. println "Creating job for $printrow.id $printrow.repo"
  18.  
  19. pipelineJob("EMT/$printrow.slug") {
  20. definition {
  21. logRotator {
  22. daysToKeep(-1)
  23. numToKeep(5)
  24. }
  25. parameters {
  26. stringParam('SLUG', "$printrow.slug", 'Slug of repo to merge tag into.')
  27. stringParam('TAG', '', 'Tag to build and merge.')
  28. }
  29. cpsScm {
  30. scm {
  31. git{
  32. remote {
  33. name('origin')
  34. url('git@bitbucket.org:glynndevins/jenkins-jobs-dsl.git')
  35. }
  36. branch('master')
  37. }
  38. scriptPath('emt/emt.groovy')
  39. }
  40. }
  41. publishers {
  42. slackNotifier {
  43. room('jenkins')
  44. notifyAborted(true)
  45. notifyFailure(true)
  46. notifyNotBuilt(true)
  47. notifyUnstable(true)
  48. notifyBackToNormal(true)
  49. notifySuccess(false)
  50. notifyRepeatedFailure(false)
  51. startNotification(false)
  52. includeTestSummary(false)
  53. includeCustomMessage(false)
  54. customMessage(null)
  55. buildServerUrl(null)
  56. sendAs(null)
  57. commitInfoChoice('NONE')
  58. teamDomain(null)
  59. authToken(null)
  60. }
  61. }
  62. }
  63. }
  64. }
  65.  
  66. sql.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement