ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject [2/3] git commit: AMBARI-3302. Parameterize the repo url for latest stack.
Date Wed, 09 Oct 2013 01:10:22 GMT
AMBARI-3302. Parameterize the repo url for latest stack.


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

Branch: refs/heads/branch-1.4.1
Commit: cc04903ad9e945bb62b3c5d4198fa7e2cdf176a2
Parents: 16e236b
Author: Sumit Mohanty <smohanty@hortonworks.com>
Authored: Wed Sep 25 11:15:53 2013 -0700
Committer: Sumit Mohanty <smohanty@hortonworks.com>
Committed: Tue Oct 8 17:57:22 2013 -0700

----------------------------------------------------------------------
 ambari-server/pom.xml                           | 63 +++++++++++++-------
 ambari-server/set-hdp-repo-url.sh               | 57 ++++++++++++++++++
 .../stacks/HDP/2.0.6/repos/repoinfo.xml         | 16 ++---
 .../stacks/HDPLocal/2.0.6/repos/repoinfo.xml    | 16 ++---
 4 files changed, 115 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/cc04903a/ambari-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index e363f8d..c72b2f0 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -29,6 +29,7 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <python.ver>python &gt;= 2.6</python.ver>
+    <hdpUrlForCentos6>http://s3.amazonaws.com/dev.hortonworks.com/HDP-2.0.6.0/repos/centos6</hdpUrlForCentos6>
   </properties>
   <build>
     <plugins>
@@ -132,24 +133,6 @@
           </excludes>
         </configuration>
       </plugin>
-      <!--<plugin>-->
-        <!-- Will be used for DDL file update on server version update-->
-        <!--<artifactId>maven-antrun-plugin</artifactId>-->
-        <!--<executions>-->
-          <!--<execution>-->
-            <!--<id>Copy-server-version-file</id>-->
-            <!--<phase>process-test-resources</phase>-->
-            <!--<configuration>-->
-              <!--<tasks>-->
-                <!--<copy file="../version" todir="${project.build.directory}/"/>-->
-              <!--</tasks>-->
-            <!--</configuration>-->
-            <!--<goals>-->
-              <!--<goal>run</goal>-->
-            <!--</goals>-->
-          <!--</execution>-->
-        <!--</executions>-->
-      <!--</plugin>-->
       <plugin>
         <!--Static -->
         <artifactId>maven-antrun-plugin</artifactId>
@@ -388,7 +371,7 @@
               <directory>/var/lib/ambari-server/resources/stacks/HDP</directory>
               <sources>
                 <source>
-                  <location>src/main/resources/stacks/HDP</location>
+                  <location>target/classes/stacks/HDP</location>
                 </source>
               </sources>
             </mapping>
@@ -397,7 +380,7 @@
               <configuration>noreplace</configuration>
               <sources>
                 <source>
-                  <location>src/main/resources/stacks/HDPLocal</location>
+                  <location>target/classes/stacks/HDPLocal</location>
                 </source>
               </sources>
             </mapping>
@@ -499,7 +482,45 @@
                   </goals>
               </execution>
           </executions>
-      </plugin>      
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.7</version>
+        <executions>
+          <execution>
+            <id>set-hdp-url-classes</id>
+            <phase>process-classes</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <target name="ambari-server-compile">
+                <exec dir="${basedir}" executable="sh" failonerror="true">
+                  <arg value="${basedir}/set-hdp-repo-url.sh"/>
+                  <arg value="${hdpUrlForCentos6}"/>
+                </exec>
+              </target>
+            </configuration>
+          </execution>
+          <execution>
+            <id>set-hdp-url-packages</id>
+            <phase>package</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <target name="ambari-server-compile">
+                <exec dir="${basedir}" executable="sh" failonerror="true">
+                  <arg value="${basedir}/set-hdp-repo-url.sh"/>
+                  <arg value="${hdpUrlForCentos6}"/>
+                  <arg value="${project.build.directory}/ambari-server-${project.version}-dist/ambari-server-${project.version}"/>
+                </exec>
+              </target>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
     <resources>
       <resource>

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/cc04903a/ambari-server/set-hdp-repo-url.sh
----------------------------------------------------------------------
diff --git a/ambari-server/set-hdp-repo-url.sh b/ambari-server/set-hdp-repo-url.sh
new file mode 100644
index 0000000..1f2e084
--- /dev/null
+++ b/ambari-server/set-hdp-repo-url.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# 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.
+#
+
+if [ "$1" != '${hdpUrlForCentos6}' ]
+then
+  # Updating for new stack version:
+  #  Create the new stack definition with parameterized repoinfo.xml files.
+  #  Typically, copying the files from the previous version will work.
+  #  Modify the VERSION variable in this file to match the new version
+  #  Modify the previous version to store concrete public repo url
+
+  VERSION=2.0.6
+  C6URL="$1"
+  C5URL="${C6URL/centos6/centos5}"
+  S11URL="${C6URL/centos6/suse11}"
+
+  if [ "$#" != 2 ]
+  then
+    HDPREPO=target/classes/stacks/HDP/${VERSION}/repos
+    HDPLOCALREPO=target/classes/stacks/HDPLocal/${VERSION}/repos
+  else
+    HDPREPO=$2/var/lib/ambari-server/resources/stacks/HDP/${VERSION}/repos
+    HDPLOCALREPO=$2/var/lib/ambari-server/resources/stacks/HDPLocal/${VERSION}/repos
+  fi
+
+  echo "Processing '${HDPREPO}/repoinfo.xml' and '${HDPLOCALREPO}/repoinfo.xml'"
+  echo "$2"
+
+  echo "Setting centos5 stack url to '$C5URL'"
+  sed "s;REPLACE_WITH_CENTOS5_URL;$C5URL;" ${HDPREPO}/repoinfo.xml >  ${HDPREPO}/repoinfo.xml.tmp;
mv ${HDPREPO}/repoinfo.xml.tmp ${HDPREPO}/repoinfo.xml
+  sed "s;REPLACE_WITH_CENTOS5_URL;$C5URL;" ${HDPLOCALREPO}/repoinfo.xml >  ${HDPLOCALREPO}/repoinfo.xml.tmp;
mv ${HDPLOCALREPO}/repoinfo.xml.tmp ${HDPLOCALREPO}/repoinfo.xml
+
+  echo "Setting centos6 stack url to '$C6URL'"
+  sed "s;REPLACE_WITH_CENTOS6_URL;$C6URL;" ${HDPREPO}/repoinfo.xml >  ${HDPREPO}/repoinfo.xml.tmp;
mv ${HDPREPO}/repoinfo.xml.tmp ${HDPREPO}/repoinfo.xml
+  sed "s;REPLACE_WITH_CENTOS6_URL;$C6URL;" ${HDPLOCALREPO}/repoinfo.xml >  ${HDPLOCALREPO}/repoinfo.xml.tmp;
mv ${HDPLOCALREPO}/repoinfo.xml.tmp ${HDPLOCALREPO}/repoinfo.xml
+
+  echo "Setting suse11 stack url to '$S11URL'"
+  sed  "s;REPLACE_WITH_SUSE11_URL;$S11URL;" ${HDPREPO}/repoinfo.xml >  ${HDPREPO}/repoinfo.xml.tmp;
mv ${HDPREPO}/repoinfo.xml.tmp ${HDPREPO}/repoinfo.xml
+  sed  "s;REPLACE_WITH_SUSE11_URL;$S11URL;" ${HDPLOCALREPO}/repoinfo.xml >  ${HDPLOCALREPO}/repoinfo.xml.tmp;
mv ${HDPLOCALREPO}/repoinfo.xml.tmp ${HDPLOCALREPO}/repoinfo.xml
+fi

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/cc04903a/ambari-server/src/main/resources/stacks/HDP/2.0.6/repos/repoinfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/repos/repoinfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.0.6/repos/repoinfo.xml
index d926412..09f1834 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/repos/repoinfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/repos/repoinfo.xml
@@ -18,56 +18,56 @@
 <reposinfo>
   <os type="centos6">
     <repo>
-      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP-2.0.6.0/repos/centos6</baseurl>
+      <baseurl>REPLACE_WITH_CENTOS6_URL</baseurl>
       <repoid>HDP-2.0.6</repoid>
       <reponame>HDP</reponame>
     </repo>
   </os>
   <os type="centos5">
     <repo>
-      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP-2.0.6.0/repos/centos5</baseurl>
+      <baseurl>REPLACE_WITH_CENTOS5_URL</baseurl>
       <repoid>HDP-2.0.6</repoid>
       <reponame>HDP</reponame>
     </repo>
   </os>
   <os type="redhat6">
     <repo>
-      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP-2.0.6.0/repos/centos6</baseurl>
+      <baseurl>REPLACE_WITH_CENTOS6_URL</baseurl>
       <repoid>HDP-2.0.6</repoid>
       <reponame>HDP</reponame>
     </repo>
   </os>
   <os type="redhat5">
     <repo>
-      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP-2.0.6.0/repos/centos5</baseurl>
+      <baseurl>REPLACE_WITH_CENTOS5_URL</baseurl>
       <repoid>HDP-2.0.6</repoid>
       <reponame>HDP</reponame>
     </repo>
   </os>
    <os type="oraclelinux6">
     <repo>
-      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP-2.0.6.0/repos/centos6</baseurl>
+      <baseurl>REPLACE_WITH_CENTOS6_URL</baseurl>
       <repoid>HDP-2.0.6</repoid>
       <reponame>HDP</reponame>
     </repo>
   </os>
   <os type="oraclelinux5">
     <repo>
-      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP-2.0.6.0/repos/centos5</baseurl>
+      <baseurl>REPLACE_WITH_CENTOS5_URL</baseurl>
       <repoid>HDP-2.0.6</repoid>
       <reponame>HDP</reponame>
     </repo>
   </os>
   <os type="suse11">
     <repo>
-      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP-2.0.6.0/repos/suse11</baseurl>
+      <baseurl>REPLACE_WITH_SUSE11_URL</baseurl>
       <repoid>HDP-2.0.6</repoid>
       <reponame>HDP</reponame>
     </repo>
   </os>
   <os type="sles11">
     <repo>
-      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP-2.0.6.0/repos/suse11</baseurl>
+      <baseurl>REPLACE_WITH_SUSE11_URL</baseurl>
       <repoid>HDP-2.0.6</repoid>
       <reponame>HDP</reponame>
     </repo>

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/cc04903a/ambari-server/src/main/resources/stacks/HDPLocal/2.0.6/repos/repoinfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDPLocal/2.0.6/repos/repoinfo.xml b/ambari-server/src/main/resources/stacks/HDPLocal/2.0.6/repos/repoinfo.xml
index d926412..09f1834 100644
--- a/ambari-server/src/main/resources/stacks/HDPLocal/2.0.6/repos/repoinfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDPLocal/2.0.6/repos/repoinfo.xml
@@ -18,56 +18,56 @@
 <reposinfo>
   <os type="centos6">
     <repo>
-      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP-2.0.6.0/repos/centos6</baseurl>
+      <baseurl>REPLACE_WITH_CENTOS6_URL</baseurl>
       <repoid>HDP-2.0.6</repoid>
       <reponame>HDP</reponame>
     </repo>
   </os>
   <os type="centos5">
     <repo>
-      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP-2.0.6.0/repos/centos5</baseurl>
+      <baseurl>REPLACE_WITH_CENTOS5_URL</baseurl>
       <repoid>HDP-2.0.6</repoid>
       <reponame>HDP</reponame>
     </repo>
   </os>
   <os type="redhat6">
     <repo>
-      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP-2.0.6.0/repos/centos6</baseurl>
+      <baseurl>REPLACE_WITH_CENTOS6_URL</baseurl>
       <repoid>HDP-2.0.6</repoid>
       <reponame>HDP</reponame>
     </repo>
   </os>
   <os type="redhat5">
     <repo>
-      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP-2.0.6.0/repos/centos5</baseurl>
+      <baseurl>REPLACE_WITH_CENTOS5_URL</baseurl>
       <repoid>HDP-2.0.6</repoid>
       <reponame>HDP</reponame>
     </repo>
   </os>
    <os type="oraclelinux6">
     <repo>
-      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP-2.0.6.0/repos/centos6</baseurl>
+      <baseurl>REPLACE_WITH_CENTOS6_URL</baseurl>
       <repoid>HDP-2.0.6</repoid>
       <reponame>HDP</reponame>
     </repo>
   </os>
   <os type="oraclelinux5">
     <repo>
-      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP-2.0.6.0/repos/centos5</baseurl>
+      <baseurl>REPLACE_WITH_CENTOS5_URL</baseurl>
       <repoid>HDP-2.0.6</repoid>
       <reponame>HDP</reponame>
     </repo>
   </os>
   <os type="suse11">
     <repo>
-      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP-2.0.6.0/repos/suse11</baseurl>
+      <baseurl>REPLACE_WITH_SUSE11_URL</baseurl>
       <repoid>HDP-2.0.6</repoid>
       <reponame>HDP</reponame>
     </repo>
   </os>
   <os type="sles11">
     <repo>
-      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP-2.0.6.0/repos/suse11</baseurl>
+      <baseurl>REPLACE_WITH_SUSE11_URL</baseurl>
       <repoid>HDP-2.0.6</repoid>
       <reponame>HDP</reponame>
     </repo>


Mime
View raw message