-
Notifications
You must be signed in to change notification settings - Fork 120
/
Jenkinsfile
29 lines (25 loc) · 1.1 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
node("cd") {
def serviceName = "books-ms"
def prodIp = "10.100.192.200"
def proxyIp = "10.100.192.200"
def swarmNode = "swarm-master"
def proxyNode = "swarm-master"
def registryIpPort = "10.100.198.200:5000"
def swarmPlaybook = "swarm-healing.yml"
def proxyPlaybook = "swarm-proxy.yml"
def instances = 1
def flow = load "/data/scripts/workflow-util.groovy"
git url: "https://github.com/vfarcic/${serviceName}.git"
flow.provision(swarmPlaybook)
flow.provision(proxyPlaybook)
flow.buildTests(serviceName, registryIpPort)
flow.runTests(serviceName, "tests", "")
flow.buildService(serviceName, registryIpPort)
def currentColor = flow.getCurrentColor(serviceName, prodIp)
def nextColor = flow.getNextColor(currentColor)
flow.deploySwarm(serviceName, prodIp, nextColor, instances)
flow.runBGPreIntegrationTests(serviceName, prodIp, nextColor)
flow.updateBGProxy(serviceName, proxyNode, nextColor)
flow.runBGPostIntegrationTests(serviceName, prodIp, proxyIp, proxyNode, currentColor, nextColor)
flow.updateChecks(serviceName, swarmNode)
}