You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hcatalog-commits@incubator.apache.org by ga...@apache.org on 2013/03/20 22:09:56 UTC

svn commit: r1459078 - in /incubator/hcatalog/trunk: ./ build-support/scripts/ core/ hcatalog-pig-adapter/ server-extensions/ storage-handlers/hbase/ webhcat/java-client/ webhcat/svr/

Author: gates
Date: Wed Mar 20 22:09:56 2013
New Revision: 1459078

URL: http://svn.apache.org/r1459078
Log:
HCATALOG-619 Update HCatalog test/release script with post-release improvements

Added:
    incubator/hcatalog/trunk/build-support/scripts/release.py
Removed:
    incubator/hcatalog/trunk/build-support/scripts/release.sh
Modified:
    incubator/hcatalog/trunk/CHANGES.txt
    incubator/hcatalog/trunk/build-support/scripts/test.sh
    incubator/hcatalog/trunk/build.properties
    incubator/hcatalog/trunk/core/pom.xml
    incubator/hcatalog/trunk/hcatalog-pig-adapter/pom.xml
    incubator/hcatalog/trunk/pom.xml
    incubator/hcatalog/trunk/server-extensions/pom.xml
    incubator/hcatalog/trunk/storage-handlers/hbase/pom.xml
    incubator/hcatalog/trunk/webhcat/java-client/pom.xml
    incubator/hcatalog/trunk/webhcat/svr/pom.xml

Modified: incubator/hcatalog/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/CHANGES.txt?rev=1459078&r1=1459077&r2=1459078&view=diff
==============================================================================
--- incubator/hcatalog/trunk/CHANGES.txt (original)
+++ incubator/hcatalog/trunk/CHANGES.txt Wed Mar 20 22:09:56 2013
@@ -26,6 +26,8 @@ Trunk (unreleased changes)
 
   IMPROVEMENTS
 
+  HCAT-619 Update HCatalog test/release script with post-release improvements (traviscrawford via gates)
+
   OPTIMIZATIONS
 
   BUG FIXES

Added: incubator/hcatalog/trunk/build-support/scripts/release.py
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/build-support/scripts/release.py?rev=1459078&view=auto
==============================================================================
--- incubator/hcatalog/trunk/build-support/scripts/release.py (added)
+++ incubator/hcatalog/trunk/build-support/scripts/release.py Wed Mar 20 22:09:56 2013
@@ -0,0 +1,117 @@
+#!/usr/bin/env python
+
+# 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.
+
+import os
+import os.path
+import subprocess
+import sys
+
+from optparse import OptionParser
+
+def get_snapshot_version():
+  with open('build.properties') as f:
+    for line in f.readlines():
+      if line.startswith('hcatalog.version='):
+        return line.strip().split('=')[1]
+
+def update_poms(release_version):
+  snapshot_version = get_snapshot_version()
+  for root, dirs, files in os.walk(os.getcwd()):
+    for filename in files:
+      if filename in ['build.properties', 'pom.xml']:
+        abs_filename = os.path.join(root, filename)
+        lines = []
+        with open(abs_filename) as f:
+          for line in f:
+            lines.append(line.replace(snapshot_version, release_version))
+        with open(abs_filename, 'w') as f:
+          f.write(''.join(lines))
+
+def main():
+  parser = OptionParser(usage=('usage: %prog [options])\n\n'
+      'This tool automates HCatalog release-releated tasks, providing '
+      'flexibility around the build and deploy process (useful for '
+      'site-specific customization). For more information, see '
+      'https://cwiki.apache.org/confluence/display/HCATALOG/HowToRelease'))
+  parser.add_option('--dry-run',
+      dest='dry_run',
+      default=False,
+      action='store_true',
+      help=('Perform a release dry run, which appends `dryrun` to the version '
+            'and does not publish artifacts to Maven. (default: %default)'))
+  parser.add_option('--release-version',
+    dest='release_version',
+    default=None,
+    help='HCatalog release version. (default: %default)')
+  parser.add_option('--forrest-home',
+    dest='forrest_home',
+    default='/usr/local/apache-forrest-0.9',
+    help='Path to the Apache Forrest home. (default: %default)')
+  parser.add_option('--mvn-deploy-repo-id',
+    dest='mvn_deploy_repo_id',
+    default='apache.releases.https',
+    help=('Maven repo id to publish to. This id must exist in your '
+          'settings.xml, along with your username/password to publish '
+          'artifacts. For more information, see '
+          'http://maven.apache.org/settings.html#Servers (default: %default)'))
+  parser.add_option('--mvn-deploy-repo-url',
+    dest='mvn_deploy_repo_url',
+    default='https://repository.apache.org/service/local/staging/deploy/maven2',
+    help='Maven repo URL to publish to. (default: %default)')
+  parser.add_option('--ant-args',
+    dest='ant_args',
+    default=None,
+    help=('Extra args for ant, such as overriding something from '
+          '`build.properties`. (default: %default)'))
+  (options, args) = parser.parse_args()
+
+  if len(sys.argv) == 0:
+    parser.print_help()
+    sys.exit(-1)
+
+  if options.release_version is None:
+    print('Required option --release-version not set!')
+    parser.print_help()
+    sys.exit(-1)
+
+  ant_args = []
+  if os.environ.has_key('ANT_ARGS'):
+    ant_args.append(os.environ['ANT_ARGS'])
+  if options.ant_args is not None:
+    ant_args.append(options.ant_args)
+
+  if options.dry_run:
+    options.release_version = '%s-dryrun' % options.release_version
+  else:
+    ant_args.extend([
+      '-Dmvn.deploy.repo.id=%s' % options.mvn_deploy_repo_id,
+      '-Dmvn.deploy.repo.url=%s' % options.mvn_deploy_repo_url,
+    ])
+    os.environ['HCAT_MVN_DEPLOY'] = 'true'
+
+  os.environ['FORREST_HOME'] = options.forrest_home
+  os.environ['ANT_ARGS'] = ' '.join(ant_args)
+
+  update_poms(options.release_version)
+
+  subprocess.Popen(os.path.join(os.path.dirname(__file__), 'test.sh'),
+      env=os.environ, stdout=sys.stdout, stderr=sys.stderr).communicate()
+
+if __name__ == '__main__':
+  main()

Modified: incubator/hcatalog/trunk/build-support/scripts/test.sh
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/build-support/scripts/test.sh?rev=1459078&r1=1459077&r2=1459078&view=diff
==============================================================================
--- incubator/hcatalog/trunk/build-support/scripts/test.sh (original)
+++ incubator/hcatalog/trunk/build-support/scripts/test.sh Wed Mar 20 22:09:56 2013
@@ -55,8 +55,10 @@ run_cmd
 
 # Build and run tests with hadoop20. This must happen afterwards so test results
 # are available for CI to publish.
-cmd='ant -Dtest.junit.output.format=xml clean releaseaudit package test'
+cmd="ant -Dtest.junit.output.format=xml -Dforrest.home=${FORREST_HOME} clean releaseaudit package test"
 if [ "${HUDSON_URL}" == "https://builds.apache.org/" ]; then
   cmd="${cmd} mvn-deploy"
+elif [ "${HCAT_MVN_DEPLOY}" == "true" ]; then
+  cmd="${cmd} mvn-deploy-signed"
 fi
 run_cmd

Modified: incubator/hcatalog/trunk/build.properties
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/build.properties?rev=1459078&r1=1459077&r2=1459078&view=diff
==============================================================================
--- incubator/hcatalog/trunk/build.properties (original)
+++ incubator/hcatalog/trunk/build.properties Wed Mar 20 22:09:56 2013
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-hcatalog.version=0.6.0-SNAPSHOT
+hcatalog.version=1.0-gates
 jar.name=${ant.project.name}-${hcatalog.version}.jar
 hcatalog.jar=${ant.project.name}-${hcatalog.version}.jar
 hcatalog.core.jar=${ant.project.name}-core-${hcatalog.version}.jar

Modified: incubator/hcatalog/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/core/pom.xml?rev=1459078&r1=1459077&r2=1459078&view=diff
==============================================================================
--- incubator/hcatalog/trunk/core/pom.xml (original)
+++ incubator/hcatalog/trunk/core/pom.xml Wed Mar 20 22:09:56 2013
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.hcatalog</groupId>
         <artifactId>hcatalog</artifactId>
-        <version>0.6.0-SNAPSHOT</version>
+        <version>1.0-gates</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
@@ -32,7 +32,7 @@
     <groupId>org.apache.hcatalog</groupId>
     <artifactId>hcatalog-core</artifactId>
     <packaging>jar</packaging>
-    <version>0.6.0-SNAPSHOT</version>
+    <version>1.0-gates</version>
     <name>hcatalog-core</name>
     <url>http://maven.apache.org</url>
 

Modified: incubator/hcatalog/trunk/hcatalog-pig-adapter/pom.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/hcatalog-pig-adapter/pom.xml?rev=1459078&r1=1459077&r2=1459078&view=diff
==============================================================================
--- incubator/hcatalog/trunk/hcatalog-pig-adapter/pom.xml (original)
+++ incubator/hcatalog/trunk/hcatalog-pig-adapter/pom.xml Wed Mar 20 22:09:56 2013
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.hcatalog</groupId>
         <artifactId>hcatalog</artifactId>
-        <version>0.6.0-SNAPSHOT</version>
+        <version>1.0-gates</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
@@ -32,7 +32,7 @@
     <groupId>org.apache.hcatalog</groupId>
     <artifactId>hcatalog-pig-adapter</artifactId>
     <packaging>jar</packaging>
-    <version>0.6.0-SNAPSHOT</version>
+    <version>1.0-gates</version>
     <name>hcatalog-pig-adapter</name>
     <url>http://maven.apache.org</url>
 

Modified: incubator/hcatalog/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/pom.xml?rev=1459078&r1=1459077&r2=1459078&view=diff
==============================================================================
--- incubator/hcatalog/trunk/pom.xml (original)
+++ incubator/hcatalog/trunk/pom.xml Wed Mar 20 22:09:56 2013
@@ -51,7 +51,7 @@
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.apache.hcatalog</groupId>
   <artifactId>hcatalog</artifactId>
-  <version>0.6.0-SNAPSHOT</version>
+  <version>1.0-gates</version>
   <packaging>pom</packaging>
 
   <build>

Modified: incubator/hcatalog/trunk/server-extensions/pom.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/server-extensions/pom.xml?rev=1459078&r1=1459077&r2=1459078&view=diff
==============================================================================
--- incubator/hcatalog/trunk/server-extensions/pom.xml (original)
+++ incubator/hcatalog/trunk/server-extensions/pom.xml Wed Mar 20 22:09:56 2013
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.hcatalog</groupId>
         <artifactId>hcatalog</artifactId>
-        <version>0.6.0-SNAPSHOT</version>
+        <version>1.0-gates</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
@@ -32,7 +32,7 @@
     <groupId>org.apache.hcatalog</groupId>
     <artifactId>hcatalog-server-extensions</artifactId>
     <packaging>jar</packaging>
-    <version>0.6.0-SNAPSHOT</version>
+    <version>1.0-gates</version>
     <name>server-extensions</name>
     <url>http://maven.apache.org</url>
 

Modified: incubator/hcatalog/trunk/storage-handlers/hbase/pom.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/storage-handlers/hbase/pom.xml?rev=1459078&r1=1459077&r2=1459078&view=diff
==============================================================================
--- incubator/hcatalog/trunk/storage-handlers/hbase/pom.xml (original)
+++ incubator/hcatalog/trunk/storage-handlers/hbase/pom.xml Wed Mar 20 22:09:56 2013
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.hcatalog</groupId>
     <artifactId>hcatalog</artifactId>
-    <version>0.6.0-SNAPSHOT</version>
+    <version>1.0-gates</version>
     <relativePath>../../pom.xml</relativePath>
   </parent>
 
@@ -32,7 +32,7 @@
   <groupId>org.apache.hcatalog</groupId>
   <artifactId>hbase-storage-handler</artifactId>
   <packaging>jar</packaging>
-  <version>0.6.0-SNAPSHOT</version>
+  <version>1.0-gates</version>
   <name>hbase-storage-handler</name>
   <url>http://maven.apache.org</url>
 

Modified: incubator/hcatalog/trunk/webhcat/java-client/pom.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/java-client/pom.xml?rev=1459078&r1=1459077&r2=1459078&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/java-client/pom.xml (original)
+++ incubator/hcatalog/trunk/webhcat/java-client/pom.xml Wed Mar 20 22:09:56 2013
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.hcatalog</groupId>
         <artifactId>hcatalog</artifactId>
-        <version>0.6.0-SNAPSHOT</version>
+        <version>1.0-gates</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
@@ -32,7 +32,7 @@
     <groupId>org.apache.hcatalog</groupId>
     <artifactId>webhcat-java-client</artifactId>
     <packaging>jar</packaging>
-    <version>0.6.0-SNAPSHOT</version>
+    <version>1.0-gates</version>
     <name>webhcat-java-client</name>
     <url>http://maven.apache.org</url>
 

Modified: incubator/hcatalog/trunk/webhcat/svr/pom.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/svr/pom.xml?rev=1459078&r1=1459077&r2=1459078&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/svr/pom.xml (original)
+++ incubator/hcatalog/trunk/webhcat/svr/pom.xml Wed Mar 20 22:09:56 2013
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.hcatalog</groupId>
         <artifactId>hcatalog</artifactId>
-        <version>0.6.0-SNAPSHOT</version>
+        <version>1.0-gates</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
@@ -32,7 +32,7 @@
     <groupId>org.apache.hcatalog</groupId>
     <artifactId>webhcat</artifactId>
     <packaging>jar</packaging>
-    <version>0.6.0-SNAPSHOT</version>
+    <version>1.0-gates</version>
     <name>webhcat</name>
     <url>http://maven.apache.org</url>