@@ -28,6 +28,7 @@ class GitCloneWorkflowStep implements StepPlugin, Describable{
28
28
29
29
public final static String GIT_URL = " gitUrl"
30
30
public final static String GIT_BASE_DIRECTORY = " gitBaseDirectory"
31
+ public final static String GIT_LOG_DISABLE = " gitLogDisable"
31
32
public final static String GIT_BRANCH = " gitBranch"
32
33
public final static String GIT_HOSTKEY_CHECKING = " strictHostKeyChecking"
33
34
public final static String GIT_KEY_STORAGE = " gitKeyPath"
@@ -62,6 +63,8 @@ class GitCloneWorkflowStep implements StepPlugin, Describable{
62
63
null ,null ,null , renderingOptionsConfig))
63
64
.property(PropertyUtil . string(GIT_BRANCH , " Branch" , " Checkout branch." , true ,
64
65
" master" ,null ,null , renderingOptionsConfig))
66
+ .property(PropertyUtil . bool(GIT_LOG_DISABLE , " Disable log output" , " Enabling this flag, the plugin will not show the output log" , true ,
67
+ " false" ,null , renderingOptionsConfig))
65
68
.property(PropertyUtil . string(GIT_PASSWORD_STORAGE , " Git Password" , ' Password to authenticate remotely' , false ,
66
69
null ,null ,null , renderingOptionsAuthenticationPassword))
67
70
.property(PropertyUtil . select(GIT_HOSTKEY_CHECKING , " SSH: Strict Host Key Checking" , ''' Use strict host key checking.
@@ -126,11 +129,13 @@ If `yes`, require remote host SSH key is defined in the `~/.ssh/known_hosts` fil
126
129
try {
127
130
gitManager. cloneOrCreate(base)
128
131
129
- def jsonMap = base. listFiles(). collect {file ->
130
- return [name : file. name, directory : file. directory, file : file. file, path : file. absolutePath]
132
+ if (! Boolean . parseBoolean((String ) configuration. get(GIT_LOG_DISABLE ))) {
133
+ def jsonMap = base. listFiles(). collect { file ->
134
+ return [name : file. name, directory : file. directory, file : file. file, path : file. absolutePath]
135
+ }
136
+ def json = JsonOutput . toJson(jsonMap)
137
+ logger. log(2 , json, meta)
131
138
}
132
- def json = JsonOutput . toJson(jsonMap)
133
- logger. log(2 , json, meta)
134
139
135
140
}catch (Exception e){
136
141
logger. log(0 , e. getMessage())
0 commit comments