ソースを参照

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

Yusaku Sako 11 年 前
コミット
04ed90db03
2 ファイル変更29 行追加2 行削除
  1. 28 1
      ambari-web/pom.xml
  2. 1 1
      ambari-web/set-ambari-version.sh

+ 28 - 1
ambari-web/pom.xml

@@ -34,6 +34,33 @@
   </properties>
   <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>
@@ -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">

+ 1 - 1
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