瀏覽代碼

AMBARI-10114 - [WinTP2] Automatic Bootstrap Ambari Agent Create the bootstrap script dependencies archive at build time

Artem Baranchuk 10 年之前
父節點
當前提交
a67afa9450

+ 26 - 2
ambari-server/pom.xml

@@ -134,17 +134,40 @@
         <artifactId>maven-assembly-plugin</artifactId>
         <configuration>
           <descriptors>
-            <descriptor>${assemblydescriptor}</descriptor>
+            <descriptor>../ambari-project/src/main/assemblies/empty.xml</descriptor>
           </descriptors>
-          <tarLongFileMode>gnu</tarLongFileMode>
         </configuration>
         <executions>
+          <execution>
+            <id>bootstrap-zip</id>
+            <phase>prepare-package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+            <configuration>
+              <attach>false</attach>
+              <finalName>bootstrap</finalName>
+              <appendAssemblyId>false</appendAssemblyId>
+              <tarLongFileMode>gnu</tarLongFileMode>
+              <descriptors>
+                <descriptor>${assemblybootstrap}</descriptor>
+              </descriptors>
+            </configuration>
+          </execution>
           <execution>
             <id>build-tarball</id>
             <phase>package</phase>
             <goals>
               <goal>single</goal>
             </goals>
+            <configuration>
+              <attach>false</attach>
+              <appendAssemblyId>true</appendAssemblyId>
+              <tarLongFileMode>gnu</tarLongFileMode>
+              <descriptors>
+                <descriptor>${assemblydescriptor}</descriptor>
+              </descriptors>
+            </configuration>
           </execution>
         </executions>
       </plugin>
@@ -1309,6 +1332,7 @@
         <fileextension.dot.shell-default>.cmd</fileextension.dot.shell-default>
         <path.python.1>${project.basedir}\..\ambari-common\src\main\python;${project.basedir}\..\ambari-agent\src\main\python;${project.basedir}\..\ambari-common\src\main\python\ambari_jinja2;${project.basedir}\..\ambari-common\src\main\python\ambari_commons;${project.basedir}\..\ambari-common\src\test\python;${project.basedir}\src\main\python;${project.basedir}\src\main\python\ambari-server-state;${project.basedir}\src\main\resources\custom_actions;${project.basedir}\src\main\resources\scripts;${project.basedir}\src\test\python</path.python.1>
         <assemblydescriptor>src/main/assemblies/server-windows.xml</assemblydescriptor>
+        <assemblybootstrap>src/main/assemblies/bootstrap-windows.xml</assemblybootstrap>
         <packagingFormat>jar</packagingFormat>
       </properties>
       <build>

+ 36 - 0
ambari-server/src/main/assemblies/bootstrap-windows.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<assembly>
+  <id>bootstrap</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <files>
+    <file>
+      <source>${basedir}/src/main/python/setupAgent.py</source>
+    </file>
+  </files>
+  <fileSets>
+    <fileSet>
+      <directory>${basedir}/../ambari-common/src/main/python/ambari_commons</directory>
+      <outputDirectory>ambari_commons</outputDirectory>
+    </fileSet>
+  </fileSets>
+</assembly>

+ 4 - 4
ambari-server/src/main/assemblies/server-windows.xml

@@ -31,6 +31,10 @@
       <source>${project.build.directory}/DBConnectionVerification.jar</source>
       <outputDirectory>ambari-server-${project.version}/resources</outputDirectory>
     </file>
+    <file>
+      <source>${project.build.directory}/bootstrap.zip</source>
+      <outputDirectory>/ambari-server-${project.version}/bootstrap</outputDirectory>
+    </file>
     <file>
       <source>${basedir}/conf/windows/ambari.properties</source>
       <outputDirectory>/ambari-server-${project.version}/conf</outputDirectory>
@@ -59,10 +63,6 @@
       <source>${basedir}/src/main/python/bootstrap.py</source>
       <outputDirectory>/ambari-server-${project.version}/bootstrap</outputDirectory>
     </file>
-    <file>
-      <source>${basedir}/src/main/python/setupAgent.py</source>
-      <outputDirectory>/ambari-server-${project.version}/bootstrap</outputDirectory>
-    </file>
     <file>
       <source>${basedir}/src/main/windows/ambari-server.cmd</source>
       <outputDirectory>/ambari-server-${project.version}</outputDirectory>