Skip to content
Permalink
Browse files

[FIXED JENKINS-9557] adding a flag to prevent account modification

  • Loading branch information
olamy committed May 2, 2011
1 parent 834fcc4 commit 155398cd5245ba73338195e12c5ac447fa32c247
@@ -227,6 +227,9 @@ public void handleBytesWritten(long deltaCount, long totalWritten, long totalToS

private final CopyOnWriteList<CloudbeesAccount> accounts = new CopyOnWriteList<CloudbeesAccount>();

// public so could be disable programatically
public boolean disableAccountSetup = false;

// configurable ?
// so here last with a public static field it's possible to change tru a groovy script
public static String CLOUDBEES_API_URL = "https://api.cloudbees.com/api";
@@ -322,6 +325,10 @@ public void setAccounts(CloudbeesAccount cloudbeesAccount) {
return accounts.toArray(new CloudbeesAccount[accounts.size()]);
}

public boolean isDisableAccountSetup() {
return disableAccountSetup || "true".equalsIgnoreCase( System.getProperty( "cloudbees.disableAccountSetup" ));
}

@Override
public boolean isApplicable(Class<? extends AbstractProject> jobType) {
// check if type of FreeStyleProject.class or MavenModuleSet.class
@@ -1,5 +1,6 @@
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<f:section title="Cloudbees">
<j:if test="${!descriptor.isDisableAccountSetup()}">
<f:entry title="${%Cloudbees accounts}" description="">
<f:repeatable name="cloudbeesaccount" var="account" items="${descriptor.accounts}">
<table width="100%">
@@ -23,5 +24,6 @@
</table>
</f:repeatable>
</f:entry>
</j:if>
</f:section>
</j:jelly>

0 comments on commit 155398c

Please sign in to comment.
You can’t perform that action at this time.