forked from krazybird/public-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbranch_test.gocd.groovy
64 lines (57 loc) · 1.75 KB
/
branch_test.gocd.groovy
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* This file was automatically exported by the GoCD Groovy DSL Plugin.
*/
GoCD.script {
branches {
matching {
// working for normal git
// pattern= ~/refs\/heads\/.*/
// from = git {
// url = "http://github.com/krazybird/public-repo"
// materialUsername = "krazybird"
// materialPassword = lookup('github.auth.token')
// }
// from = github {
// fullRepoName = 'gocd-private/aws'
// materialUrl = "https://github.com/gocd-private/aws"
// apiAuthToken = lookup('github.auth.token')
// }
// from = gitlab {
// apiAuthToken = lookup("gitlab.auth.token")
// fullRepoName = "testing-group12/public-repo"
// materialUsername = "kritika-singh3"
// materialPassword = lookup("gitlab.auth.token")
// }
from = bitbucket {
fullRepoName = "kritika-singh3/public-repo"
apiUser = "kritika-singh3"
apiPass = lookup("bitbucket.auth.token")
}
// works for notifications with 196 one
// from = github {
// fullRepoName = 'krazybird/public-repo'
//// materialUrl = "https://github.com/krazybird/public-repo"
// apiAuthToken = lookup('github.auth.token')
// }
onMatch { ctx ->
pipeline("testing-branch-${ctx.branchSanitized}") {
group = "testing"
materials { add(ctx.repo) }
stages {
stage('stage') {
jobs {
job('job') {
tasks {
exec { commandLine = ['sleep', '30'] }
exec { commandLine = ['ls'] }
}
}
}
}
}
ctx.repo.notifiesBy(ctx.provider)
}
}
}
}
}