-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
63 lines (52 loc) · 1.37 KB
/
Jenkinsfile
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
WLUrl = 'http://localhost:8001'
def servers
stage 'Prerequisites'
node {
checkout scm
dir('./OracleJDK/java-8') {
sh "cp /opt/jre/server-jre-8u92-linux-x64.tar.gz ."
sh "./build.sh"
}
dir('./OracleWebLogic/dockerfiles') {
sh "cp /opt/weblogic/fmw_12.2.1.0.0_wls_quick_Disk1_1of1.zip ./12.2.1/"
sh "./buildDockerImage.sh -v 12.2.1 -d"
}
dir('./OracleWebLogic/samples/1221-domain') {
sh "docker build --build-arg ADMIN_PASSWORD=luxoftadmin1 -t 1221-domain ."
}
}
stage 'Build'
node {
dir('./demo') {
mvn 'clean package'
dir('target') {stash name: 'war', includes: 'x.war'}
}
}
stage 'QA'
node {
servers = load 'demo/servers.groovy'
runTests(servers, 30)
}
stage name: 'Staging', concurrency: 1
node {
servers.deploy 'staging'
}
input message: "Does ${WLUrl}staging/ look good?"
stage name: 'Production', concurrency: 1
node {
sh "wget -O - -S ${WLUrl}/staging/"
echo 'Production server looks to be alive'
servers.deploy 'production'
echo "Deployed to ${WLUrl}/production/"
}
def mvn(args) {
sh "${tool 'M3'}/bin/mvn ${args}"
}
def runTests(servers, duration) {
node {
checkout scm
servers.runWithServer {id ->
mvn "-f demo/sometests test -Durl=${WLUrl}/${id}/ -Dduration=${duration}"
}
}
}