Author: jaimin
Date: Mon Apr 15 23:10:36 2013
New Revision: 1468267

URL: http://svn.apache.org/r1468267
Log:
AMBARI-1928. Make experimental Ambari Web features toggleable via mvn build. 
(yusaku via jaimin)

Added:
    incubator/ambari/trunk/ambari-web/toggle-experimental.sh
Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/config.js
    incubator/ambari/trunk/ambari-web/pom.xml

Modified: incubator/ambari/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1468267&r1=1468266&r2=1468267&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Mon Apr 15 23:10:36 2013
@@ -257,6 +257,9 @@ Trunk (unreleased changes):
  (Sumit Mohanty via mahadev)
 
  IMPROVEMENTS
+
+ AMBARI-1928. Make experimental Ambari Web features toggleable
+ via mvn build. (yusaku via jaimin)
  
  AMBARI-1906. Make experimental Ambari Web features toggleable 
  (turned on/off via config file). (yusaku via jaimin)

Modified: incubator/ambari/trunk/ambari-web/app/config.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/config.js?rev=1468267&r1=1468266&r2=1468267&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/config.js (original)
+++ incubator/ambari/trunk/ambari-web/app/config.js Mon Apr 15 23:10:36 2013
@@ -35,22 +35,23 @@ App.contentUpdateInterval = 15000;
 App.maxRunsForAppBrowser = 500;
 App.pageReloadTime=3600000;
 
-App.disableAllSupports = false;
+// experimental features are automatically enabled if running on brunch server
+App.enableExperimental = (location.port == '3333');
 
 App.supports = {
   addServices: false,
-  hostOverrides: true,
-  mirroring: true,
-  secureCluster: true,
-  reassignMaster: true,
-  stackUpgrade: true,
-  capacitySchedulerUi: true,
-  startStopAllServices: true
+  hostOverrides: false,
+  mirroring: false,
+  secureCluster: false,
+  reassignMaster: false,
+  stackUpgrade: false,
+  capacitySchedulerUi: false,
+  startStopAllServices: false
 };
 
-if (App.disableAllSupports) {
+if (App.enableExperimental) {
   for (var support in App.supports) {
-    App.supports[support] = false;
+    App.supports[support] = true;
   }
 }
 

Modified: incubator/ambari/trunk/ambari-web/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/pom.xml?rev=1468267&r1=1468266&r2=1468267&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/pom.xml (original)
+++ incubator/ambari/trunk/ambari-web/pom.xml Mon Apr 15 23:10:36 2013
@@ -93,6 +93,11 @@
                 <exec dir="${basedir}" executable="brunch" failonerror="false">
                   <arg value="build"/>
                 </exec>
+                <!-- enables experimental features if enableExperimental is 
set to true -->
+                <exec dir="${basedir}" executable="sh" failonerror="false">
+                  <arg value="${basedir}/toggle-experimental.sh"/>
+                  <arg value="${enableExperimental}"/>
+                </exec>
                 <exec dir="${basedir}" executable="gzip" failonerror="false">
                   <arg value="public/javascripts/app.js"/>
                   <arg value="public/javascripts/vendor.js"/>

Added: incubator/ambari/trunk/ambari-web/toggle-experimental.sh
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/toggle-experimental.sh?rev=1468267&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-web/toggle-experimental.sh (added)
+++ incubator/ambari/trunk/ambari-web/toggle-experimental.sh Mon Apr 15 
23:10:36 2013
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ "$1" == "true" ]
+then
+  echo 'Enabling experimental features...'
+  sed 's/App.enableExperimental.*=.*;/App.enableExperimental = true;/' 
public/javascripts/app.js > public/javascripts/tmp.js; mv 
public/javascripts/tmp.js public/javascripts/app.js
+fi


Reply via email to