ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject ambari git commit: AMBARI-12623. [PluggableStackDefinition] Integrate pluggable stack definition into build
Date Mon, 03 Aug 2015 17:21:32 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk a2e653594 -> d6058d956


AMBARI-12623. [PluggableStackDefinition] Integrate pluggable stack definition into build


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

Branch: refs/heads/trunk
Commit: d6058d956fcc190edefe534c5441977f2d2b3791
Parents: a2e6535
Author: Sumit Mohanty <smohanty@hortonworks.com>
Authored: Mon Aug 3 10:21:17 2015 -0700
Committer: Sumit Mohanty <smohanty@hortonworks.com>
Committed: Mon Aug 3 10:21:17 2015 -0700

----------------------------------------------------------------------
 ambari-agent/pom.xml                         | 75 +++++++++++++++++++++--
 ambari-server/pom.xml                        | 65 ++++++++++++++++++--
 ambari-server/src/main/assemblies/server.xml |  2 +-
 3 files changed, 131 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d6058d95/ambari-agent/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml
index 853a70f..6ed8bff 100644
--- a/ambari-agent/pom.xml
+++ b/ambari-agent/pom.xml
@@ -51,6 +51,8 @@
     <target.cache.dir>${project.build.directory}/cache/</target.cache.dir>
     <resource.keeper.script>${ambari.server.module}/src/main/python/ambari_server/resourceFilesKeeper.py</resource.keeper.script>
     <init.d.dir>/etc/rc.d/init.d</init.d.dir>
+    <resourceManagementSrcLocation>${project.basedir}/../ambari-common/src/main/python/resource_management</resourceManagementSrcLocation>
+    <resourcesFolder>${ambari.server.module}/src/main/resources</resourcesFolder>
   </properties>
   <build>
     <plugins>
@@ -266,7 +268,7 @@
               <groupname>root</groupname>
               <sources>
                 <source>
-                  <location>${project.basedir}/../ambari-common/src/main/python/resource_management</location>
+                  <location>${resourceManagementSrcLocation}</location>
                 </source>
               </sources>
             </mapping>
@@ -661,7 +663,7 @@
             </data>
             <data>
               <src>
-                ${project.basedir}/../ambari-common/src/main/python/resource_management
+                ${resourceManagementSrcLocation}
               </src>
               <type>directory</type>
               <mapper>
@@ -691,11 +693,29 @@
                 <resource>
                   <directory>${ambari.server.module}/src/main/resources</directory>
                   <includes>
+                    <include>custom_actions/**/*</include>
+                    <include>host_scripts/**/*</include>
+                  </includes>
+                  <filtering>false</filtering>
+                </resource>
+              </resources>
+            </configuration>
+          </execution>
+          <execution>
+            <id>copy-common-resources</id>
+            <phase>prepare-package</phase>
+            <goals>
+              <goal>copy-resources</goal>
+            </goals>
+            <configuration>
+              <outputDirectory>${target.cache.dir}</outputDirectory>
+              <resources>
+                <resource>
+                  <directory>${resourcesFolder}</directory>
+                  <includes>
                     <include>common-services/**</include>
                     <include>stacks/stack_advisor.py</include>
                     <include>stacks/${stack.distribution}/**/*</include>
-                    <include>custom_actions/**/*</include>
-                    <include>host_scripts/**/*</include>
                   </includes>
                   <filtering>false</filtering>
                 </resource>
@@ -899,5 +919,52 @@
         <init.d.dir>/etc/init.d</init.d.dir>
       </properties>
     </profile>
+    <profile>
+      <id>pluggable-stack-definition</id>
+      <activation>
+        <activeByDefault>false</activeByDefault>
+        <property>
+          <name>pluggableStackDefinitionConfig</name>
+        </property>
+      </activation>
+      <properties>
+        <resourceManagementSrcLocation>target/pluggable-stack-definition/python/resource_management</resourceManagementSrcLocation>
+        <resourcesFolder>target/pluggable-stack-definition</resourcesFolder>
+        <resourcesSrcLocation>${project.basedir}/../ambari-server/src/main/resources</resourcesSrcLocation>
+        <pluggableStackDefinitionScriptLocation>${project.basedir}/../ambari-common/src/main/python/pluggable_stack_definition/GenerateStackDefinition.py</pluggableStackDefinitionScriptLocation>
+        <pluggableStackDefinitionConfig>${project.basedir}/../ambari-common/src/main/python/pluggable_stack_definition/configs/${stack.distribution}.json</pluggableStackDefinitionConfig>
+        <pluggableStackDefinitionOutput>target/pluggable-stack-definition</pluggableStackDefinitionOutput>
+      </properties>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>exec-maven-plugin</artifactId>
+            <version>1.2.1</version>
+            <executions>
+              <execution>
+                <configuration>
+                  <executable>${executable.python}</executable>
+                  <arguments>
+                    <argument>${pluggableStackDefinitionScriptLocation}</argument>
+                    <argument>-c</argument>
+                    <argument>${pluggableStackDefinitionConfig}</argument>
+                    <argument>-r</argument>
+                    <argument>${resourcesSrcLocation}</argument>
+                    <argument>-o</argument>
+                    <argument>${pluggableStackDefinitionOutput}</argument>
+                  </arguments>
+                </configuration>
+                <id>pluggable-stack-definition-generate</id>
+                <phase>generate-resources</phase>
+                <goals>
+                  <goal>exec</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
   </profiles>
 </project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6058d95/ambari-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 0de6419..74d1837 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -40,6 +40,10 @@
     <ambari-web-dir>${basedir}/../ambari-web/public</ambari-web-dir>
     <ambari-admin-dir>${basedir}/../ambari-admin</ambari-admin-dir>
     <contrib-views-dir>${basedir}/../contrib/views</contrib-views-dir>
+    <resourceManagementSrcLocation>${project.basedir}/../ambari-common/src/main/python/resource_management</resourceManagementSrcLocation>
+    <commonServicesSrcLocation>target/classes/common-services</commonServicesSrcLocation>
+    <stacksSrcLocation>target/classes/stacks/${stack.distribution}</stacksSrcLocation>
+    <tarballResourcesFolder>src/main/resources</tarballResourcesFolder>
     <skipPythonTests>false</skipPythonTests>
   </properties>
   <build>
@@ -323,7 +327,7 @@
               <sources>
                 <source>
                   <location>
-                    ${project.basedir}/../ambari-common/src/main/python/resource_management
+                    ${resourceManagementSrcLocation}
                   </location>
                 </source>
               </sources>
@@ -575,7 +579,7 @@
               <directory>/var/lib/ambari-server/resources/common-services</directory>
               <sources>
                 <source>
-                  <location>target/classes/common-services</location>
+                  <location>${commonServicesSrcLocation}</location>
                 </source>
               </sources>
             </mapping>
@@ -591,7 +595,7 @@
               <directory>/var/lib/ambari-server/resources/stacks/${stack.distribution}</directory>
               <sources>
                 <source>
-                  <location>target/classes/stacks/${stack.distribution}</location>
+                  <location>${stacksSrcLocation}</location>
                 </source>
               </sources>
             </mapping>
@@ -1010,7 +1014,7 @@
               </mapper>
             </data>
             <data>
-              <src>target/classes/common-services</src>
+              <src>${commonServicesSrcLocation}</src>
               <type>directory</type>
               <mapper>
                 <type>perm</type>
@@ -1026,7 +1030,7 @@
               </mapper>
             </data>
             <data>
-              <src>target/classes/stacks/${stack.distribution}</src>
+              <src>${stacksSrcLocation}</src>
               <type>directory</type>
               <mapper>
                 <type>perm</type>
@@ -1141,7 +1145,7 @@
             </data>
             <data>
               <src>
-                ${project.basedir}/../ambari-common/src/main/python/resource_management
+                ${resourceManagementSrcLocation}
               </src>
               <type>directory</type>
               <mapper>
@@ -1506,6 +1510,55 @@
         <python.xml.package>python-xml</python.xml.package>
       </properties>
     </profile>
+    <profile>
+      <id>pluggable-stack-definition</id>
+      <activation>
+        <activeByDefault>false</activeByDefault>
+        <property>
+          <name>pluggableStackDefinitionConfig</name>
+        </property>
+      </activation>
+      <properties>
+        <resourceManagementSrcLocation>target/pluggable-stack-definition/python/resource_management</resourceManagementSrcLocation>
+        <commonServicesSrcLocation>target/pluggable-stack-definition/common-services</commonServicesSrcLocation>
+        <stacksSrcLocation>target/pluggable-stack-definition/stacks/${stack.distribution}</stacksSrcLocation>
+        <resourcesSrcLocation>src/main/resources</resourcesSrcLocation>
+        <tarballResourcesFolder>target/pluggable-stack-definition</tarballResourcesFolder>
+        <pluggableStackDefinitionScriptLocation>${project.basedir}/../ambari-common/src/main/python/pluggable_stack_definition/GenerateStackDefinition.py</pluggableStackDefinitionScriptLocation>
+        <pluggableStackDefinitionConfig>${project.basedir}/../ambari-common/src/main/python/pluggable_stack_definition/configs/${stack.distribution}.json</pluggableStackDefinitionConfig>
+        <pluggableStackDefinitionOutput>target/pluggable-stack-definition</pluggableStackDefinitionOutput>
+      </properties>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>exec-maven-plugin</artifactId>
+            <version>1.2.1</version>
+            <executions>
+              <execution>
+                <configuration>
+                  <executable>${executable.python}</executable>
+                  <arguments>
+                    <argument>${pluggableStackDefinitionScriptLocation}</argument>
+                    <argument>-c</argument>
+                    <argument>${pluggableStackDefinitionConfig}</argument>
+                    <argument>-r</argument>
+                    <argument>${resourcesSrcLocation}</argument>
+                    <argument>-o</argument>
+                    <argument>${pluggableStackDefinitionOutput}</argument>
+                  </arguments>
+                </configuration>
+                <id>pluggable-stack-definition-generate</id>
+                <phase>prepare-package</phase>
+                <goals>
+                  <goal>exec</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
   </profiles>
   <dependencies>
     <dependency>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6058d95/ambari-server/src/main/assemblies/server.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/assemblies/server.xml b/ambari-server/src/main/assemblies/server.xml
index 58d1a73..0c88810 100644
--- a/ambari-server/src/main/assemblies/server.xml
+++ b/ambari-server/src/main/assemblies/server.xml
@@ -90,7 +90,7 @@
       <outputDirectory>/ambari-server-${project.version}/etc/ambari-server/conf</outputDirectory>
     </fileSet>
     <fileSet>
-      <directory>src/main/resources</directory>
+      <directory>${tarballResourcesFolder}</directory>
       <outputDirectory>/ambari-server-${project.version}/var/lib/ambari-server/resources/</outputDirectory>
       <includes>
         <include>common-services/**</include>


Mime
View raw message