-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathtemplate.groovy
executable file
·51 lines (43 loc) · 1.03 KB
/
template.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
#!/usr/bin/env groovy
//
// Author: Hari Sekhon
// Date: [% DATE # 2012-10-14 13:19:29 +0100 (Sun, 14 Oct 2012) %]
//
// vim:ts=4:sts=4:sw=4:et
//
// [% URL %]
//
// [% LICENSE %]
//
// [% MESSAGE %]
//
// [% LINKEDIN %]
//
// ========================================================================== //
// G r o o v y
// ========================================================================== //
// Jenkins Shared Library function
def call(Map args = [:]) {
args.var = args.var ?: 'default_value'
withEnv(["VAR=${args.var}"]){
sh (
label: 'MyLabel',
script: '''
set -eux
echo "key = name, value = $VAR"
'''
)
}
}
// ================
// Groovy Scripting
//
// http://docs.groovy-lang.org/latest/html/documentation/grape.html
@GrabConfig(systemClassLoader=true)
@Grab(group='mysql', module='mysql-connector-java', version='5.1.6')
// =====================
// or old class stuff
class [% NAME %] {
static void main(String[] args) throws Exception {
}
}