@@ -26,21 +26,28 @@ pipeline {
2626 script : '''
2727 import jenkins.model.Jenkins
2828 def defaultVal = ""
29+ def errorMsg = ""
2930 try {
3031 def envVarsNodePropertyList = Jenkins.instance.globalNodeProperties.getAll(hudson.slaves.EnvironmentVariablesNodeProperty)
3132 if (envVarsNodePropertyList && envVarsNodePropertyList[0]) {
3233 defaultVal = envVarsNodePropertyList[0].envVars.get("DEFAULT_COUCHBASE_LITE_VERSION") ?: ""
3334 }
3435 } catch (Throwable t) {
35- defaultVal = "Exception: " + t.toString()
36+ errorMsg = "Exception retrieving default : " + t.toString().replace("'", "'").replace("<", "<").replace(">", ">" )
3637 }
37- return "<input name='value' value='" + defaultVal + "' class='setting-input' type='text'>"
38+ defaultVal = defaultVal.replace("'", "'").replace("<", "<").replace(">", ">")
39+ def html = "<input name='value' value='" + defaultVal + "' class='setting-input' type='text'>"
40+ if (errorMsg) {
41+ html += "<div class='description' style='color: #d9534f; margin-top: 5px;'>" + errorMsg + "</div>"
42+ }
43+ return html
3844 ''' ,
3945 sandbox : false
4046 ],
4147 fallbackScript : [
4248 script : '''
43- return "<input name='value' value='Error: Script approval required or execution failed.' class='setting-input' type='text' style='color: red; border: 1px solid red;'>"
49+ return "<input name='value' value='' class='setting-input' type='text' placeholder='Enter COUCHBASE_LITE_VERSION...'>" +
50+ "<div class='description' style='color: #d9534f; margin-top: 5px;'>Error: Script approval required or execution failed. Check Jenkins script approvals if this is not populated. Please enter the version manually.</div>"
4451 ''' ,
4552 sandbox : false
4653 ]
@@ -56,21 +63,28 @@ pipeline {
5663 script : '''
5764 import jenkins.model.Jenkins
5865 def defaultVal = ""
66+ def errorMsg = ""
5967 try {
6068 def envVarsNodePropertyList = Jenkins.instance.globalNodeProperties.getAll(hudson.slaves.EnvironmentVariablesNodeProperty)
6169 if (envVarsNodePropertyList && envVarsNodePropertyList[0]) {
6270 defaultVal = envVarsNodePropertyList[0].envVars.get("DEFAULT_COUCHBASE_SERVER_VERSION") ?: ""
6371 }
6472 } catch (Throwable t) {
65- defaultVal = "Exception: " + t.toString()
73+ errorMsg = "Exception retrieving default: " + t.toString().replace("'", "'").replace("<", "<").replace(">", ">")
74+ }
75+ defaultVal = defaultVal.replace("'", "'").replace("<", "<").replace(">", ">")
76+ def html = "<input name='value' value='" + defaultVal + "' class='setting-input' type='text'>"
77+ if (errorMsg) {
78+ html += "<div class='description' style='color: #d9534f; margin-top: 5px;'>" + errorMsg + "</div>"
6679 }
67- return "<input name='value' value='" + defaultVal + "' class='setting-input' type='text'>"
80+ return html
6881 ''' ,
6982 sandbox : false
7083 ],
7184 fallbackScript : [
7285 script : '''
73- return "<input name='value' value='Error: Script approval required or execution failed.' class='setting-input' type='text' style='color: red; border: 1px solid red;'>"
86+ return "<input name='value' value='' class='setting-input' type='text' placeholder='Enter COUCHBASE_SERVER_VERSION...'>" +
87+ "<div class='description' style='color: #d9534f; margin-top: 5px;'>Error: Script approval required or execution failed. Check Jenkins script approvals if this is not populated. Please enter the version manually.</div>"
7488 ''' ,
7589 sandbox : false
7690 ]
@@ -92,9 +106,9 @@ pipeline {
92106 steps {
93107 cleanWs()
94108 git(
95- url : ' https:// github.com/ couchbase/sync_gateway.git' ,
96- branch : " ${ params.SG_COMMIT} " ,
97- credentialsId : ' CB_SG_Robot_Github_SSH_Key'
109+ url : ' git@ github.com: couchbase/sync_gateway.git' ,
110+ branch : " ${ params.SG_COMMIT} " ,
111+ credentialsId : ' CB_SG_Robot_Github_SSH_Key'
98112 )
99113 }
100114 }
0 commit comments