Created
September 23, 2016 16:23
-
-
Save jjtroberts/1e41c91b5d20e6df75e935b44d5b80f6 to your computer and use it in GitHub Desktop.
Seed from DB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment