Last active
January 28, 2019 17:04
-
-
Save zhouqiang-cl/90c5fa160a763a447c101e3c43918e14 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// manager hold status | |
// groovy hold stage | |
def cfg = [:] | |
cfg["type"] = "tidb-cluster" | |
cfg["size"] = {"tikv":{"size":3,"version":"111"},"tidb":{"size":1,"version":"x"},"pd":{"size":1,"version":"x"}} | |
def cat = new Cat(cfg) // Cat is an function, type specify what kind of cat should be start | |
def monitor = new Monitor() // when script is quit, monitor will quit | |
def reportor = new Reportor("oncall-sre") // if it create repotor, then default reportor will not report | |
stage("prepare") { | |
cat.Start() // Start will start cat and fill cat field | |
monitor.add_item(cat) | |
reportor.add_item(cat) | |
} | |
ddl = new Ddl(cat.service_ip, params1) | |
ddl_pod = new Pod(ddl) | |
upgrade = new Upgrade(cat, params2) | |
upgrade_pod = new Pod(upgrade) | |
stage("running") { | |
timeout(30) { | |
ddl_pod.Start() | |
monitor.add_item(ddl_pod) | |
reportor.add_item(ddl_pod) | |
upgrade_pod.Start() | |
monitor.add_item(upgrade_pod) | |
reportor.add_item(upgrade_pod) | |
} | |
} | |
stage("finish") { | |
reportor.Report() | |
pod.Destory() | |
cat.Destory() | |
} | |
status("failed") { | |
reportor.Report() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment