You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2014/04/01 22:09:17 UTC

git commit: AMBARI-5233. Ambari server and UI should use the same version when making a build. (yusaku)

Repository: ambari
Updated Branches:
  refs/heads/trunk 90dee5179 -> 04ed90db0


AMBARI-5233. Ambari server and UI should use the same version when making a build. (yusaku)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/04ed90db
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/04ed90db
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/04ed90db

Branch: refs/heads/trunk
Commit: 04ed90db03cc8211482c0c5875ae6e11451fbc77
Parents: 90dee51
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Tue Apr 1 13:03:27 2014 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Tue Apr 1 13:09:00 2014 -0700

----------------------------------------------------------------------
 ambari-web/pom.xml               | 29 ++++++++++++++++++++++++++++-
 ambari-web/set-ambari-version.sh |  2 +-
 2 files changed, 29 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/04ed90db/ambari-web/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-web/pom.xml b/ambari-web/pom.xml
index b4e9390..24daecb 100644
--- a/ambari-web/pom.xml
+++ b/ambari-web/pom.xml
@@ -35,6 +35,33 @@
   <build>
     <plugins>
       <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <version>1.8</version>
+        <executions>
+          <execution>
+            <id>parse-version</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>parse-version</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>regex-property</id>
+            <goals>
+              <goal>regex-property</goal>
+            </goals>
+            <configuration>
+              <name>ambariVersion</name>
+                <value>${project.version}</value>
+                <regex>-SNAPSHOT</regex>
+                <replacement></replacement>
+              <failIfNoMatch>false</failIfNoMatch>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
         <artifactId>maven-compiler-plugin</artifactId>
         <version>3.0</version>
       </plugin>
@@ -99,7 +126,7 @@
                 <!-- sets Ambari version to make it accessible from code -->
                 <exec dir="${basedir}" executable="sh" failonerror="false">
                   <arg value="${basedir}/set-ambari-version.sh"/>
-                  <arg value="${newVersion}"/>
+                  <arg value="${ambariVersion}"/>
                 </exec>
                 <!-- sets default stack and version to use for install -->
                 <exec dir="${basedir}" executable="sh" failonerror="false">

http://git-wip-us.apache.org/repos/asf/ambari/blob/04ed90db/ambari-web/set-ambari-version.sh
----------------------------------------------------------------------
diff --git a/ambari-web/set-ambari-version.sh b/ambari-web/set-ambari-version.sh
index a661c48..e1cead4 100644
--- a/ambari-web/set-ambari-version.sh
+++ b/ambari-web/set-ambari-version.sh
@@ -18,7 +18,7 @@
 # under the License.
 #
 
-if [ "$1" != '${newVersion}' ]
+if [ "$1" != '${ambariVersion}' ]
 then
   echo "Setting Ambari version to $1"
   sed "s/App.version.*=.*;/App.version = '$1';/" public/javascripts/app.js > public/javascripts/tmp.js; mv public/javascripts/tmp.js public/javascripts/app.js