Skip to content

Commit 627aba0

Browse files
author
Derek Smart
committed
refactor delphix object to reuse session
Signed-off-by: Derek Smart <derek.smart@delphix.com>
1 parent ee7910f commit 627aba0

File tree

1 file changed

+1
-4
lines changed
  • src/main/kotlin/com/delphix/yamlparser

1 file changed

+1
-4
lines changed

src/main/kotlin/com/delphix/yamlparser/Runner.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class Runner (
2222
}
2323

2424
fun callDelphix(datapod: String, environment: String, event: String) {
25-
delphix.login(env["delphixUser"]?: "", env["delphixPass"]?: "")
2625
when (event){
2726
"bookmark.create" -> currentAction = delphix.selfServiceBookmark().create(getBuildTag(environment), datapod)
2827
"bookmark.share" -> currentAction = delphix.selfServiceBookmark().share(getBuildTag(environment))
@@ -54,9 +53,7 @@ class Runner (
5453
}
5554
}
5655

57-
5856
fun jobConflictExists(datapod: String): Boolean {
59-
delphix.login(env["delphixUser"]?: "", env["delphixPass"]?: "")
6057
val container = delphix.selfServiceContainer().getRefByName(datapod)
6158
var jobs = delphix.job().getWhereRunning()
6259
for(job in jobs) {
@@ -65,7 +62,6 @@ class Runner (
6562
return false
6663
}
6764

68-
6965
fun execActionPhase(environment: Environment) {
7066
for (action in environment.actions) {
7167
if (action.event == env["gitEvent"]) {
@@ -82,6 +78,7 @@ class Runner (
8278
}
8379

8480
fun run() {
81+
delphix.login(env["delphixUser"]?: "", env["delphixPass"]?: "")
8582
for(environment in yaml.environments) {
8683
if (environment.branch == env["gitBranch"]) execActionPhase(environment)
8784
}

0 commit comments

Comments
 (0)