Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-9557] adding a flag to prevent account modification
  • Loading branch information
olamy committed May 2, 2011
1 parent 834fcc4 commit 155398c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Expand Up @@ -227,6 +227,9 @@ public static final class DescriptorImpl

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";
Expand Down Expand Up @@ -322,6 +325,10 @@ public CloudbeesAccount[] getAccounts() {
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
Expand Down
@@ -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%">
Expand All @@ -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.