-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from ivanmolodec/develop
- Loading branch information
Showing
10 changed files
with
90 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package ru.pulsar.jenkins.library.steps | ||
|
||
import ru.pulsar.jenkins.library.IStepExecutor | ||
import ru.pulsar.jenkins.library.ioc.ContextRegistry | ||
import ru.pulsar.jenkins.library.utils.Constants | ||
|
||
class RingCommand implements Serializable { | ||
|
||
private String script | ||
private boolean returnStatus | ||
private boolean returnStdout | ||
|
||
RingCommand(String script) { | ||
this.script = script | ||
this.returnStatus = false | ||
this.returnStdout = true | ||
}; | ||
|
||
def run() { | ||
IStepExecutor steps = ContextRegistry.getContext().getStepExecutor() | ||
|
||
def ringOpts = [Constants.DEFAULT_RING_OPTS] | ||
steps.withEnv(ringOpts) { | ||
String ringMessage = steps.cmd(script, returnStatus, returnStdout) | ||
if (ringMessage.contains("error")) { | ||
steps.error(ringMessage) | ||
} | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import ru.pulsar.jenkins.library.steps.Cmd | ||
import ru.pulsar.jenkins.library.ioc.ContextRegistry | ||
|
||
int call(String script, boolean returnStatus = false) { | ||
def call(String script, boolean returnStatus = false, boolean returnStdout = false ) { | ||
ContextRegistry.registerDefaultContext(this) | ||
|
||
Cmd cmd = new Cmd(script, returnStatus) | ||
Cmd cmd = new Cmd(script, returnStatus, returnStdout) | ||
return cmd.run() | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import ru.pulsar.jenkins.library.ioc.ContextRegistry | ||
import ru.pulsar.jenkins.library.steps.RingCommand | ||
|
||
def call(String script ) { | ||
ContextRegistry.registerDefaultContext(this) | ||
|
||
RingCommand ringCommand = new RingCommand(script) | ||
return ringCommand.run() | ||
} |