-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathjenkins-build.groovy
More file actions
38 lines (32 loc) · 883 Bytes
/
jenkins-build.groovy
File metadata and controls
38 lines (32 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
folder('dockerfiles') {
description('Personnal Dockerfiles')
}
def directory = new File("$WORKSPACE")
directory.eachFile (groovy.io.FileType.DIRECTORIES) { file ->
def dockerFile = file.getName()
if (dockerFile == ".git") {
return
}
def dockerName = "jdecool/$dockerFile"
def jenkinsPath = "dockerfiles/$dockerFile"
freeStyleJob("$jenkinsPath") {
scm {
git("git@github.com:jdecool/dockerfiles.git")
}
logRotator {
numToKeep(10)
}
triggers {
cron('15 0 * * *')
}
steps {
dockerBuildAndPublish {
buildContext(file.toString())
repositoryName("$dockerName")
forceTag(false)
registryCredentials('dockerio-registry')
noCache(true)
}
}
}
}