Skip to content

Commit

Permalink
fix(Config): Resolve config save error [JENKINS-59149]
Browse files Browse the repository at this point in the history
  • Loading branch information
hypery2k committed Oct 11, 2019
1 parent 3d886e6 commit 05c758f
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,52 @@ public String getBuildServerUrl() {
}
}

@DataBoundSetter
public void setRocketServerUrl(String rocketServerUrl) {
this.rocketServerUrl = rocketServerUrl;
}

@DataBoundSetter
public void setUsername(String username) {
this.username = username;
}

@DataBoundSetter
public void setPassword(String password) {
this.password = password;
}

@DataBoundSetter
public void setChannel(String channel) {
this.channel = channel;
}

@DataBoundSetter
public void setBuildServerUrl(String buildServerUrl) {
this.buildServerUrl = buildServerUrl;
if (buildServerUrl == null || buildServerUrl.equalsIgnoreCase("")) {
JenkinsLocationConfiguration jenkinsConfig = new JenkinsLocationConfiguration();
this.buildServerUrl = jenkinsConfig.getUrl();
}
if (buildServerUrl != null && !buildServerUrl.endsWith("/")) {
this.buildServerUrl = buildServerUrl + "/";
}
}

@DataBoundSetter
public void setTrustSSL(boolean trustSSL) {
this.trustSSL = trustSSL;
}
@DataBoundSetter
public void setWebhookToken(String webhookToken) {
this.webhookToken = webhookToken;
}

@DataBoundSetter
public void setWebhookTokenCredentialId(String webhookTokenCredentialId) {
this.webhookTokenCredentialId = webhookTokenCredentialId;
}

public boolean isApplicable(Class<? extends AbstractProject> aClass) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,34 @@
tags they use. Views are always organized according to its owner class,
so it should be straightforward to find them.
-->
<f:section title="Global RocketChat Notifier Settings" name="rocket">
<f:section title="Global RocketChat Notifier Settings">
<f:entry title="Rocket Server URL">
<f:textbox field="rocketServerUrl" clazz="required" name="rocketServerUrl"/>
</f:entry>
<f:entry title="Trust Server Certificate?"
description="If checked, the SSL certificate of the Rocket Server will not be checked">
<f:checkbox field="trustSSL" name="trustSSL"/>
</f:entry>
<f:entry title="Login Username">
<f:textbox field="username" name="username" help="Login of the user. Can also be the user id for token based login"/>
</f:entry>
<f:entry title="Login password">
<f:password field="password" name="password" help="Password of the rocketchat user. Can be also the personal access token"/>
</f:entry>
<f:entry title="Webhook Token Credential ID">
<f:textbox field="webhookTokenCredentialId" name="webhookTokenCredentialId" help="Webhook token as Secret Text credential for posting messages. Overrides webhook token text."/>
</f:entry>
<f:entry title="Webhook Token">
<f:password field="webhookToken" name="webhookToken" help="As alternative for login/password you can use the webhook token here"/>
</f:entry>
<f:entry title="Channel" description="Comma separated list of rooms (e.g. #project) and / or persons (e.g. @john)">
<f:textbox field="channel" name="channel" />
</f:entry>
<f:entry title="Build Server URL">
<f:textbox field="buildServerUrl" name="buildServerUrl"/>
</f:entry>
<f:textbox field="channel" clazz="required" name="channel" />
</f:entry>
<f:advanced>
<f:entry title="Trust Server Certificate?"
description="If checked, the SSL certificate of the Rocket Server will not be checked">
<f:checkbox field="trustSSL" name="trustSSL"/>
</f:entry>
<f:entry title="Webhook Token Credential ID">
<f:textbox field="webhookTokenCredentialId" name="webhookTokenCredentialId" help="Webhook token as Secret Text credential for posting messages. Overrides webhook token text."/>
</f:entry>
<f:entry title="Webhook Token">
<f:password field="webhookToken" name="webhookToken" help="As alternative for login/password you can use the webhook token here"/>
</f:entry>
<f:entry title="Build Server URL">
<f:textbox field="buildServerUrl" name="buildServerUrl"/>
</f:entry>
</f:advanced>
<f:validateButton
title="${%Test Connection}" progress="${%Testing...}"
method="testConnection"
Expand Down

0 comments on commit 05c758f

Please sign in to comment.