Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import groovy.sql.Sql
- def db = "jenkins"
- def user = "jenkins_user"
- def pwd = "xxxxxxxx"
- def sql = Sql.newInstance(
- "jdbc:mysql://localhost:3306/${db}",
- "${user}",
- "${pwd}",
- "com.mysql.jdbc.Driver"
- )
- // Select all records from the emt table
- println "\n------------------------------Select All Email Master Template clones-------------------------------------\n"
- sql.eachRow("select * from emts") { printrow ->
- println "Creating job for $printrow.id $printrow.repo"
- pipelineJob("EMT/$printrow.slug") {
- definition {
- logRotator {
- daysToKeep(-1)
- numToKeep(5)
- }
- parameters {
- stringParam('SLUG', "$printrow.slug", 'Slug of repo to merge tag into.')
- stringParam('TAG', '', 'Tag to build and merge.')
- }
- cpsScm {
- scm {
- git{
- remote {
- name('origin')
- url('git@bitbucket.org:glynndevins/jenkins-jobs-dsl.git')
- }
- branch('master')
- }
- scriptPath('emt/emt.groovy')
- }
- }
- publishers {
- slackNotifier {
- room('jenkins')
- notifyAborted(true)
- notifyFailure(true)
- notifyNotBuilt(true)
- notifyUnstable(true)
- notifyBackToNormal(true)
- notifySuccess(false)
- notifyRepeatedFailure(false)
- startNotification(false)
- includeTestSummary(false)
- includeCustomMessage(false)
- customMessage(null)
- buildServerUrl(null)
- sendAs(null)
- commitInfoChoice('NONE')
- teamDomain(null)
- authToken(null)
- }
- }
- }
- }
- }
- sql.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement