Skip to content

Commit

Permalink
Merge pull request #14 from mad-mags/master
Browse files Browse the repository at this point in the history
Added option to hide log output after git clone in rundeck output tab
  • Loading branch information
ltamaster authored Jul 22, 2020
2 parents ef1703b + 11ed487 commit fe62679
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main/groovy/com/rundeck/plugin/GitCloneWorkflowStep.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class GitCloneWorkflowStep implements StepPlugin, Describable{

public final static String GIT_URL="gitUrl"
public final static String GIT_BASE_DIRECTORY="gitBaseDirectory"
public final static String GIT_LOG_DISABLE ="gitLogDisable"
public final static String GIT_BRANCH="gitBranch"
public final static String GIT_HOSTKEY_CHECKING="strictHostKeyChecking"
public final static String GIT_KEY_STORAGE="gitKeyPath"
Expand Down Expand Up @@ -62,6 +63,8 @@ class GitCloneWorkflowStep implements StepPlugin, Describable{
null,null,null, renderingOptionsConfig))
.property(PropertyUtil.string(GIT_BRANCH, "Branch", "Checkout branch.", true,
"master",null,null, renderingOptionsConfig))
.property(PropertyUtil.bool(GIT_LOG_DISABLE, "Disable log output", "Enabling this flag, the plugin will not show the output log", true,
"false",null, renderingOptionsConfig))
.property(PropertyUtil.string(GIT_PASSWORD_STORAGE, "Git Password", 'Password to authenticate remotely', false,
null,null,null, renderingOptionsAuthenticationPassword))
.property(PropertyUtil.select(GIT_HOSTKEY_CHECKING, "SSH: Strict Host Key Checking", '''Use strict host key checking.
Expand Down Expand Up @@ -126,11 +129,13 @@ If `yes`, require remote host SSH key is defined in the `~/.ssh/known_hosts` fil
try{
gitManager.cloneOrCreate(base)

def jsonMap = base.listFiles().collect {file ->
return [name: file.name, directory: file.directory, file: file.file, path: file.absolutePath]
if (!Boolean.parseBoolean((String) configuration.get(GIT_LOG_DISABLE))) {
def jsonMap = base.listFiles().collect { file ->
return [name: file.name, directory: file.directory, file: file.file, path: file.absolutePath]
}
def json = JsonOutput.toJson(jsonMap)
logger.log(2, json, meta)
}
def json = JsonOutput.toJson(jsonMap)
logger.log(2, json, meta)

}catch(Exception e){
logger.log(0, e.getMessage())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class GitResourceModelFactory implements ResourceModelSourceFactory,Describable

public final static String GIT_URL="gitUrl"
public final static String GIT_BASE_DIRECTORY="gitBaseDirectory"
public final static String GIT_LOG_DISABLE ="gitLogDisable"
public final static String GIT_FILE="gitFile"
public final static String GIT_FORMAT_FILE="gitFormatFile"
public final static String GIT_BRANCH="gitBranch"
Expand Down Expand Up @@ -66,6 +67,8 @@ Some examples:
null,null,null, renderingOptionsConfig))
.property(PropertyUtil.string(GIT_BRANCH, "Branch", "Checkout branch.", true,
"master",null,null, renderingOptionsConfig))
.property(PropertyUtil.bool(GIT_LOG_DISABLE, "Disable log output", "Enabling this flag, the plugin will not show the output log", true,
"false",null, renderingOptionsConfig))
.property(PropertyUtil.string(GIT_FILE, "Resource model File", "Resource model file inside the github repo.", true,
null,null,null, renderingOptionsConfig))
.property(PropertyUtil.select(GIT_FORMAT_FILE, "File Format", 'File Format', true,
Expand Down

0 comments on commit fe62679

Please sign in to comment.