Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinston Prakash2012-11-27 21:29:09 -0500
committerWinston Prakash2012-11-27 21:29:09 -0500
commit28bb28226ad3ece95cb5b7d0090e30c40f11ed66 (patch)
treefef0197e660a7d6e89836f5e1cffd9804530264f
parentaabc34edbf4712bc1cba4c1932eff0e8280a828a (diff)
downloadorg.eclipse.hudson.core-28bb28226ad3ece95cb5b7d0090e30c40f11ed66.tar.gz
org.eclipse.hudson.core-28bb28226ad3ece95cb5b7d0090e30c40f11ed66.tar.xz
org.eclipse.hudson.core-28bb28226ad3ece95cb5b7d0090e30c40f11ed66.zip
Remove the need to install Mandatory plugins via Initial Setup. Initial setup now allows installations of "Compatibility" plugins. The users are allowed to skip init setup by clicking the finish button with out installing any plugins.
The init setup can be skipped using the flag --skipInitSetup
-rw-r--r--hudson-core/src/main/java/org/eclipse/hudson/init/InitialSetup.java89
-rw-r--r--hudson-core/src/main/java/org/eclipse/hudson/init/InitialSetupLogin.java9
-rw-r--r--hudson-core/src/main/java/org/eclipse/hudson/plugins/PluginCenter.java4
-rw-r--r--hudson-core/src/main/java/org/eclipse/hudson/plugins/UpdateSiteManager.java2
-rw-r--r--hudson-core/src/main/resources/org/eclipse/hudson/init/InitialSetup/index.jelly41
-rw-r--r--hudson-core/src/main/resources/org/eclipse/hudson/init/InitialSetupLogin/index.jelly32
-rw-r--r--hudson-core/src/main/resources/org/eclipse/hudson/plugins/PluginCenter/PluginSearchList/index.jelly15
-rw-r--r--hudson-core/src/main/resources/org/eclipse/hudson/plugins/PluginCenter/index.jelly60
-rw-r--r--hudson-jetty-war-executable/src/main/java/org/eclipse/hudson/jetty/JettyLauncher.java11
-rw-r--r--hudson-war/src/main/webapp/scripts/init-setup.js50
10 files changed, 160 insertions, 153 deletions
diff --git a/hudson-core/src/main/java/org/eclipse/hudson/init/InitialSetup.java b/hudson-core/src/main/java/org/eclipse/hudson/init/InitialSetup.java
index 67883a45..1d79e958 100644
--- a/hudson-core/src/main/java/org/eclipse/hudson/init/InitialSetup.java
+++ b/hudson-core/src/main/java/org/eclipse/hudson/init/InitialSetup.java
@@ -55,7 +55,7 @@ import org.slf4j.LoggerFactory;
/**
* Provides support for initial setup during first run. Gives opportunity to
* Hudson Admin to - Install mandatory, featured and recommended plugins -
- * Update mandatory, featured and recommended plugins suitable for current
+ * Update compatiblity, featured and recommended plugins suitable for current
* Hudson - Provide Authentication if needed - Setup proxy if required
*
* @author Winston Prakash
@@ -73,9 +73,9 @@ final public class InitialSetup {
private List<AvailablePluginInfo> installedFeaturedPlugins = new ArrayList<AvailablePluginInfo>();
private List<AvailablePluginInfo> installableFeaturedPlugins = new ArrayList<AvailablePluginInfo>();
private List<AvailablePluginInfo> updatableFeaturedPlugins = new ArrayList<AvailablePluginInfo>();
- private List<AvailablePluginInfo> installedMandatoryPlugins = new ArrayList<AvailablePluginInfo>();
- private List<AvailablePluginInfo> installableMandatoryPlugins = new ArrayList<AvailablePluginInfo>();
- private List<AvailablePluginInfo> updatableMandatoryPlugins = new ArrayList<AvailablePluginInfo>();
+ private List<AvailablePluginInfo> installedCompatibilityPlugins = new ArrayList<AvailablePluginInfo>();
+ private List<AvailablePluginInfo> installableCompatibilityPlugins = new ArrayList<AvailablePluginInfo>();
+ private List<AvailablePluginInfo> updatableCompatibilityPlugins = new ArrayList<AvailablePluginInfo>();
private ProxyConfiguration proxyConfig;
private ExecutorService installerService = Executors.newSingleThreadExecutor(
new DaemonThreadFactory(new ThreadFactory() {
@@ -106,12 +106,10 @@ final public class InitialSetup {
}
public boolean needsInitSetup() {
- if (!initSetupFile.exists()) {
- return (installableMandatoryPlugins.size() > 0) || (updatableMandatoryPlugins.size() > 0)
- || (installableFeaturedPlugins.size() > 0) || (updatableFeaturedPlugins.size() > 0)
- || (installableRecommendedPlugins.size() > 0) || (updatableRecommendedPlugins.size() > 0);
+ if (initSetupFile.exists() || Boolean.getBoolean("skipInitSetup")) {
+ return false;
} else {
- return !canFinish();
+ return true;
}
}
@@ -155,22 +153,22 @@ final public class InitialSetup {
return updatableFeaturedPlugins;
}
- public List<AvailablePluginInfo> getInstallableMandatoryPlugins() {
- return installableMandatoryPlugins;
+ public List<AvailablePluginInfo> getInstallableCompatibilityPlugins() {
+ return installableCompatibilityPlugins;
}
- public List<AvailablePluginInfo> getInstalledMandatoryPlugins() {
- return installedMandatoryPlugins;
+ public List<AvailablePluginInfo> getInstalledCompatibilityPlugins() {
+ return installedCompatibilityPlugins;
}
- public List<AvailablePluginInfo> getUpdatableMandatoryPlugins() {
- return updatableMandatoryPlugins;
+ public List<AvailablePluginInfo> getUpdatableCompatibilityPlugins() {
+ return updatableCompatibilityPlugins;
}
public InstalledPluginInfo getInstalled(AvailablePluginInfo plugin) {
return installedPluginManager.getInstalledPlugin(plugin.getName());
}
-
+
public List<AvailablePluginInfo> getUpdatablePlugins() {
List<AvailablePluginInfo> updatablePlugins = new ArrayList<AvailablePluginInfo>();
Set<String> installedPluginNames = installedPluginManager.getInstalledPluginNames();
@@ -255,19 +253,15 @@ final public class InitialSetup {
return HttpResponses.ok();
}
- public HttpResponse doCheckFinish() {
- if (!canFinish()) {
- return new ErrorHttpResponse("Mandatory Plugins need to be installed first");
- } else {
- try {
- initSetupFile.write("Hudson 3.0 Initial Setup Done");
- } catch (IOException ex) {
- logger.error(ex.getLocalizedMessage());
- }
- invokeHudson();
-
- return HttpResponses.ok();
+ public HttpResponse doFinish() {
+ try {
+ initSetupFile.write("Hudson 3.0 Initial Setup Done");
+ } catch (IOException ex) {
+ logger.error(ex.getLocalizedMessage());
}
+ invokeHudson();
+
+ return HttpResponses.ok();
}
public void invokeHudson() {
@@ -308,11 +302,6 @@ final public class InitialSetup {
}.start();
}
- public boolean canFinish() {
- reCheck();
- return (getInstallableMandatoryPlugins().size() == 0) && (getUpdatableMandatoryPlugins().size() == 0);
- }
-
private static class ErrorHttpResponse implements HttpResponse {
private String message;
@@ -381,9 +370,9 @@ final public class InitialSetup {
installedFeaturedPlugins.clear();
installableFeaturedPlugins.clear();
updatableFeaturedPlugins.clear();
- installableMandatoryPlugins.clear();
- installedMandatoryPlugins.clear();
- updatableMandatoryPlugins.clear();
+ installableCompatibilityPlugins.clear();
+ installedCompatibilityPlugins.clear();
+ updatableCompatibilityPlugins.clear();
installedPluginManager.loadInstalledPlugins();
check();
}
@@ -399,14 +388,14 @@ final public class InitialSetup {
if (installedPluginNames.contains(pluginName)) {
//Installed
InstalledPluginInfo installedPlugin = installedPluginManager.getInstalledPlugin(pluginName);
- if (availablePlugin.getType().equals(UpdateSiteManager.MANDATORY)) {
- //Installed Mandatory Plugin
+ if (availablePlugin.getType().equals(UpdateSiteManager.COMPATIBILITY)) {
+ //Installed Compatibility Plugin
if (isNewerThan(availablePlugin.getVersion(), installedPlugin.getVersion())) {
- //Updatabale Mandatory Plugin update needed
- updatableMandatoryPlugins.add(availablePlugin);
+ //Updatabale Compatibility Plugin update needed
+ updatableCompatibilityPlugins.add(availablePlugin);
} else {
- //Installed Mandatory Plugin. No updates available
- installedMandatoryPlugins.add(availablePlugin);
+ //Installed Compatibility Plugin. No updates available
+ installedCompatibilityPlugins.add(availablePlugin);
}
} else if (availablePlugin.getType().equals(UpdateSiteManager.FEATURED)) {
if (isNewerThan(availablePlugin.getVersion(), installedPlugin.getVersion())) {
@@ -428,9 +417,9 @@ final public class InitialSetup {
} else {
//Not installed
- if (availablePlugin.getType().equals(UpdateSiteManager.MANDATORY)) {
+ if (availablePlugin.getType().equals(UpdateSiteManager.COMPATIBILITY)) {
//Mandatory Plugin. Need to be installed
- installableMandatoryPlugins.add(availablePlugin);
+ installableCompatibilityPlugins.add(availablePlugin);
}
if (availablePlugin.getType().equals(UpdateSiteManager.FEATURED)) {
//Featured Plugin. Available for installation
@@ -469,18 +458,18 @@ final public class InitialSetup {
return deps;
}
-
+
protected void refreshUpdateCenterMetadataCache() throws IOException {
-
- try{
+
+ try {
updateSiteManager.refreshFromUpdateSite();
return;
- }catch(Exception exc){
+ } catch (Exception exc) {
proxyNeeded = true;
logger.info("Could not fetch update center metadata from " + updateSiteManager.getUpdateSiteUrl() + ". Using bundled update center metadata.");
}
-
-
+
+
URL updateCenterJsonUrl = servletContext.getResource("/WEB-INF/update-center.json");
if (updateCenterJsonUrl != null) {
long lastModified = updateCenterJsonUrl.openConnection().getLastModified();
diff --git a/hudson-core/src/main/java/org/eclipse/hudson/init/InitialSetupLogin.java b/hudson-core/src/main/java/org/eclipse/hudson/init/InitialSetupLogin.java
index c364cae9..57c03d37 100644
--- a/hudson-core/src/main/java/org/eclipse/hudson/init/InitialSetupLogin.java
+++ b/hudson-core/src/main/java/org/eclipse/hudson/init/InitialSetupLogin.java
@@ -41,12 +41,8 @@ final public class InitialSetupLogin {
return hudsonSecurityManager;
}
- public boolean canFinish() {
- return initialSetup.canFinish();
- }
-
public HttpResponse doFinish() {
- return initialSetup.doCheckFinish();
+ return initialSetup.doFinish();
}
public HttpResponse doContinue() {
@@ -56,4 +52,7 @@ final public class InitialSetupLogin {
initialSetup.getServletContext().setAttribute("app", initialSetup);
return HttpResponses.ok();
}
+ public boolean needsAdminLogin() {
+ return !hudsonSecurityManager.hasPermission(Permission.HUDSON_ADMINISTER);
+ }
}
diff --git a/hudson-core/src/main/java/org/eclipse/hudson/plugins/PluginCenter.java b/hudson-core/src/main/java/org/eclipse/hudson/plugins/PluginCenter.java
index 614e061e..0cef1ebb 100644
--- a/hudson-core/src/main/java/org/eclipse/hudson/plugins/PluginCenter.java
+++ b/hudson-core/src/main/java/org/eclipse/hudson/plugins/PluginCenter.java
@@ -137,10 +137,6 @@ final public class PluginCenter {
}
return updatablePlugins;
}
-
- public boolean isMandatory(AvailablePluginInfo availablePlugin) {
- return UpdateSiteManager.MANDATORY.equals(availablePlugin.getType());
- }
public boolean isInstalled(AvailablePluginInfo availablePlugin) {
Set<String> installedPluginNames = installedPluginManager.getInstalledPluginNames();
diff --git a/hudson-core/src/main/java/org/eclipse/hudson/plugins/UpdateSiteManager.java b/hudson-core/src/main/java/org/eclipse/hudson/plugins/UpdateSiteManager.java
index b9db1499..fa831bc2 100644
--- a/hudson-core/src/main/java/org/eclipse/hudson/plugins/UpdateSiteManager.java
+++ b/hudson-core/src/main/java/org/eclipse/hudson/plugins/UpdateSiteManager.java
@@ -38,7 +38,7 @@ import org.apache.commons.io.IOUtils;
*/
public final class UpdateSiteManager {
- public static final String MANDATORY = "mandatory";
+ public static final String COMPATIBILITY = "compatibility";
public static final String FEATURED = "featured";
public static final String RECOMMENDED = "recommended";
private Map<String, AvailablePluginInfo> availablePluginInfos = new TreeMap<String, AvailablePluginInfo>(String.CASE_INSENSITIVE_ORDER);
diff --git a/hudson-core/src/main/resources/org/eclipse/hudson/init/InitialSetup/index.jelly b/hudson-core/src/main/resources/org/eclipse/hudson/init/InitialSetup/index.jelly
index d3b575e0..05acefd9 100644
--- a/hudson-core/src/main/resources/org/eclipse/hudson/init/InitialSetup/index.jelly
+++ b/hudson-core/src/main/resources/org/eclipse/hudson/init/InitialSetup/index.jelly
@@ -1,3 +1,18 @@
+<!-- **************************************************************************
+#
+# Copyright (c) 2012 Oracle Corporation.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+#
+# Winston Prakash
+#
+#************************************************************************** -->
+
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">
@@ -42,21 +57,21 @@
</span>
<ul id="installList" class="setup">
- <li class="mandatory">
+ <li class="compatibility">
<h3>
- Mandatory Plugins
+ Core Compatibility Plugins
</h3>
<p class="description">
- These plugins must be installed for Hudson to work properly.
+ These core plugins provide key extensions to Hudson to ensure maximum compatibility with a wide range of 3rd party plugins and Operating Systems function. Although these plugins are not required we <em>strongly</em> recommend that you install them to ensure maximum compatibility with the existing range of 3rd party Hudson plugins.
</p>
<div class="body">
<div class="items-container">
- <table width="100%" border="0" id="mandatoryPlugins" cellpadding="10">
- <j:forEach var="p" items="${it.installableMandatoryPlugins}">
+ <table width="100%" border="0" id="compatibilityPlugins" cellpadding="10">
+ <j:forEach var="p" items="${it.installableCompatibilityPlugins}">
<tr>
<td class="column1">
- <input type="checkbox" disabled="disabled" checked="true" value="${p.name}"/>
+ <input type="checkbox" checked="true" value="${p.name}"/>
<img id="${p.name}" style="display:none;"/>
</td>
<td class="column2">
@@ -75,10 +90,10 @@
<td class="column4"></td>
</tr>
</j:forEach>
- <j:forEach var="p" items="${it.updatableMandatoryPlugins}">
+ <j:forEach var="p" items="${it.updatableCompatibilityPlugins}">
<tr>
<td class="column1">
- <input type="checkbox" disabled="disabled" checked="true" value="${p.name}"/>
+ <input type="checkbox" checked="true" value="${p.name}"/>
<img id="${p.name}" style="display:none;"/>
</td>
<td class="column2">
@@ -100,7 +115,7 @@
</tr>
</j:forEach>
- <j:forEach var="p" items="${it.installedMandatoryPlugins}">
+ <j:forEach var="p" items="${it.installedCompatibilityPlugins}">
<tr>
<td class="column1">
<img src="${imagesURL}/green-check.jpg" alt=""/>
@@ -319,7 +334,7 @@
</ul>
<div>
<span id="infoMsg">
- <!-- Message injectd here-->
+ Select the plugins and click Install to download and install the selected plugins or click Finish to start Hudson after installing the selected plugins.
</span>
<p id="loginNeededMsg">
Note: You must
@@ -339,12 +354,6 @@
<img src="${imagesURL}/progressbar.gif" style="margin-bottom: -10px; margin-left: 5px;"/>
</div>
</div>
-
- <div>
- <span id="instalMandatoryMsg">
- All Mandatory Plugins must be installed first.
- </span>
- </div>
</div>
</div>
</div>
diff --git a/hudson-core/src/main/resources/org/eclipse/hudson/init/InitialSetupLogin/index.jelly b/hudson-core/src/main/resources/org/eclipse/hudson/init/InitialSetupLogin/index.jelly
index 1fc60a17..f32514c2 100644
--- a/hudson-core/src/main/resources/org/eclipse/hudson/init/InitialSetupLogin/index.jelly
+++ b/hudson-core/src/main/resources/org/eclipse/hudson/init/InitialSetupLogin/index.jelly
@@ -1,3 +1,18 @@
+<!-- **************************************************************************
+#
+# Copyright (c) 2012 Oracle Corporation.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+#
+# Winston Prakash
+#
+#************************************************************************** -->
+
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">
@@ -18,9 +33,8 @@
<script type="text/javascript">
var imageRoot = '${imagesURL}';
var proxyNeeded = false;
- var securitySet = ${it.hudsonSecurityManager.isUseSecurity()};
- var canFinish = ${it.canFinish()};
- var needsAdminLogin = securitySet;
+ var needsAdminLogin = ${it.needsAdminLogin()};
+ var securitySet = needsAdminLogin;
var loginUrl = "${rootURL}/${it.hudsonSecurityManager.securityRealm.authenticationGatewayUrl}";
</script>
@@ -42,16 +56,8 @@
</span>
<ul id="installList" class="setup">
<div>
- <span id="fpMandatoryMsg">
- For Hudson CI server to work properly few Mandatory Plugins need to be installed.
- You will also get a chance to install other featured and recommended plugins.
- Click continue to go to the install page.
- </span>
- <br/>
- <br/>
- <span id="fpRecommendedMsg">
- All Mandatory Plugins required for Hudson CI server to work properly are installed.
- To install the featured or recommended plugins click Continue. Click Finish to start Hudson.
+ <span id="fpInstallMsg">
+ You can click Finish to start Hudson now. However, we recommend that you click Continue to move onto the plugin installation screen where you will be able to pre-install some key features and recommended plugins into your Hudson Server.
</span>
<p id="loginNeededMsg">
diff --git a/hudson-core/src/main/resources/org/eclipse/hudson/plugins/PluginCenter/PluginSearchList/index.jelly b/hudson-core/src/main/resources/org/eclipse/hudson/plugins/PluginCenter/PluginSearchList/index.jelly
index 09335724..690be98e 100644
--- a/hudson-core/src/main/resources/org/eclipse/hudson/plugins/PluginCenter/PluginSearchList/index.jelly
+++ b/hudson-core/src/main/resources/org/eclipse/hudson/plugins/PluginCenter/PluginSearchList/index.jelly
@@ -1,3 +1,18 @@
+<!-- **************************************************************************
+#
+# Copyright (c) 2012 Oracle Corporation.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+#
+# Winston Prakash
+#
+#************************************************************************** -->
+
<?jelly escape-by-default='true'?>
<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">
<st:header name="Expires" value="0" />
diff --git a/hudson-core/src/main/resources/org/eclipse/hudson/plugins/PluginCenter/index.jelly b/hudson-core/src/main/resources/org/eclipse/hudson/plugins/PluginCenter/index.jelly
index 4339f150..9f27f7db 100644
--- a/hudson-core/src/main/resources/org/eclipse/hudson/plugins/PluginCenter/index.jelly
+++ b/hudson-core/src/main/resources/org/eclipse/hudson/plugins/PluginCenter/index.jelly
@@ -1,3 +1,18 @@
+<!-- **************************************************************************
+#
+# Copyright (c) 2012 Oracle Corporation.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+#
+# Winston Prakash
+#
+#************************************************************************** -->
+
<?jelly escape-by-default='true'?>
<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">
@@ -367,33 +382,26 @@
${it.getInstalled(p).version}
</td>
<td class="column4">
- <j:if test="${!it.isMandatory(p)}">
- <span style="font-size:10px" class="actionsColumn">
- <j:if test="${it.getInstalled(p).isEnabled()}">
- <button class="enable" value="${p.name}">Disable</button>
- </j:if>
+ <span style="font-size:10px" class="actionsColumn">
+ <j:if test="${it.getInstalled(p).isEnabled()}">
+ <button class="enable" value="${p.name}">Disable</button>
+ </j:if>
- <j:if test="${!it.getInstalled(p).isEnabled()}">
- <button class="enable" value="${p.name}">Enable</button>
- </j:if>
- <j:if test="${it.getInstalled(p).isDowngrdable()}">
- <button class="downgrade" style="margin-top: 3px; margin-bottom: 3px;" value="${p.name}" >Downgrade to ${it.getInstalled(p).backupVersion} </button>
- </j:if>
- <j:if test="${it.getInstalled(p).isPinned()}">
- <span>
- <button class="unpin" style="margin-right: 3px;" value="${p.name}">Unpin</button>
- <a href="http://wiki.hudson-ci.org/display/HUDSON/Pinned+Plugins" target="_blank">
- <img src="${imagesURL}/16x16/help.png"/>
- </a>
- </span>
- </j:if>
- </span>
- </j:if>
- <j:if test="${it.isMandatory(p)}">
- <span style="font-size:10px" class="actionsColumn">
- Mandatory Plugin
- </span>
- </j:if>
+ <j:if test="${!it.getInstalled(p).isEnabled()}">
+ <button class="enable" value="${p.name}">Enable</button>
+ </j:if>
+ <j:if test="${it.getInstalled(p).isDowngrdable()}">
+ <button class="downgrade" style="margin-top: 3px; margin-bottom: 3px;" value="${p.name}" >Downgrade to ${it.getInstalled(p).backupVersion} </button>
+ </j:if>
+ <j:if test="${it.getInstalled(p).isPinned()}">
+ <span>
+ <button class="unpin" style="margin-right: 3px;" value="${p.name}">Unpin</button>
+ <a href="http://wiki.hudson-ci.org/display/HUDSON/Pinned+Plugins" target="_blank">
+ <img src="${imagesURL}/16x16/help.png"/>
+ </a>
+ </span>
+ </j:if>
+ </span>
</td>
</tr>
</j:forEach>
diff --git a/hudson-jetty-war-executable/src/main/java/org/eclipse/hudson/jetty/JettyLauncher.java b/hudson-jetty-war-executable/src/main/java/org/eclipse/hudson/jetty/JettyLauncher.java
index 75ce3138..f923066a 100644
--- a/hudson-jetty-war-executable/src/main/java/org/eclipse/hudson/jetty/JettyLauncher.java
+++ b/hudson-jetty-war-executable/src/main/java/org/eclipse/hudson/jetty/JettyLauncher.java
@@ -48,6 +48,7 @@ public class JettyLauncher {
String updateServer = null;
boolean disableUpdateCenterSwitch = false;
+ boolean skipInitSetup = false;
for (int i = 0; i < args.length; i++) {
if (args[i].startsWith("--httpPort=")) {
@@ -80,9 +81,13 @@ public class JettyLauncher {
updateServer = args[i].substring("--updateServer=".length());
}
- if (args[i].startsWith("--disableUpdateCenterSwitch=")) {
+ if (args[i].startsWith("--disableUpdateCenterSwitch")) {
disableUpdateCenterSwitch = true;
}
+
+ if (args[i].startsWith("--skipInitSetup")) {
+ skipInitSetup = true;
+ }
}
Server server = new Server();
@@ -136,6 +141,10 @@ public class JettyLauncher {
if (disableUpdateCenterSwitch) {
System.setProperty("hudson.pluginManager.disableUpdateCenterSwitch", "true");
}
+
+ if (skipInitSetup) {
+ System.setProperty("skipInitSetup", "true");
+ }
server.setHandler(context);
server.setStopAtShutdown(true);
diff --git a/hudson-war/src/main/webapp/scripts/init-setup.js b/hudson-war/src/main/webapp/scripts/init-setup.js
index 84fef504..cc8c7453 100644
--- a/hudson-war/src/main/webapp/scripts/init-setup.js
+++ b/hudson-war/src/main/webapp/scripts/init-setup.js
@@ -24,18 +24,7 @@ var finish = false;
var forProxy = false;
var forInstall = false;
var forContinue = false;
-var canContinue = false;
-
-var mandatoryMsg = "The Mandatory Plugins are needed and cannot be deselected. " +
-"Select the featured or recommended plugins and click install " +
-"to download and install the plugins or Finish " +
-"to start Hudson after installing the plugins.";
-
-var recommendedMsg = "All Mandatory Plugins are installed. " +
-"Select the featured or recommended plugins and click install " +
-"to download and install the plugins or Finish to start Hudson " +
-"after installing the plugins.";
-
+
function installPlugin(selected){
jQuery('#errorMessage').hide();
jQuery(selected).hide();
@@ -54,9 +43,8 @@ function installPlugin(selected){
installCount--;
if (installCount == 0){
if (finish == true){
- checkFinish();
+ doFinish();
}
- showInfoMsg();
jQuery("#buttonBar").show();
jQuery("#installProgress").hide();
}
@@ -79,15 +67,7 @@ function installPlugin(selected){
dataType: "html"
});
}
-
-
-function showInfoMsg(){
- if (jQuery('#mandatoryPlugins input[@type=checkbox]:checked').length > 0){
- showMessage(jQuery('#infoMsg'), mandatoryMsg, "black");
- }else{
- showMessage(jQuery('#infoMsg'), recommendedMsg, "black");
- }
-}
+
function checkPermissionAndinstallPlugins(){
if (needsAdminLogin == true) {
@@ -116,7 +96,7 @@ function installSelectedPlugins(){
function getInstallables(){
var installables = [];
- jQuery('#mandatoryPlugins input[@type=checkbox]:checked').each(function(){
+ jQuery('#compatibilityPlugins input[@type=checkbox]:checked').each(function(){
installables.push(this);
});
jQuery('#featuredPlugins input[@type=checkbox]:checked').each(function(){
@@ -212,16 +192,17 @@ function submitLoginForm(){
});
}
-function checkFinish(){
+function doFinish(){
jQuery.ajax({
type: 'GET',
- url: "checkFinish",
+ url: "finish",
success: function(){
window.location.href=".";
},
error: function(){
- jQuery('#instalMandatoryMsg').show();
+ icon.attr('src',imageRoot + '/error.png');
+ showMessage(jQuery('#infoMsg'), msg.responseText, "red");
},
dataType: "html"
});
@@ -310,7 +291,7 @@ jQuery(document).ready(function() {
finish = true;
checkPermissionAndinstallPlugins();
}else{
- checkFinish();
+ doFinish();
}
});
@@ -338,7 +319,6 @@ jQuery(document).ready(function() {
jQuery('#continueButton').button();
jQuery('#continueButton').click(function() {
- canContinue = true;
if (securitySet == true) {
if (loggedIn == false){
forContinue = true;
@@ -346,6 +326,8 @@ jQuery(document).ready(function() {
} else {
doContinue("continue");
}
+ }else{
+ doContinue("continue");
}
});
@@ -354,14 +336,8 @@ jQuery(document).ready(function() {
doContinue("finish")
});
- if (canFinish == true){
- jQuery('#fpFinishButton').show();
- jQuery('#fpRecommendedMsg').show();
- jQuery('#fpMandatoryMsg').hide();
- }else{
- jQuery('#fpMandatoryMsg').show();
- jQuery('#fpFinishButton').hide();
- }
+ jQuery('#fpFinishButton').show();
+ jQuery('#fpInstallMsg').show();
refreshProxyUser();
}); \ No newline at end of file

Back to the top