kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lind...@apache.org
Subject [kafka] branch 1.1 updated: MINOR: update release.py
Date Fri, 20 Jul 2018 00:03:12 GMT
This is an automated email from the ASF dual-hosted git repository.

lindong pushed a commit to branch 1.1
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/1.1 by this push:
     new 776ff95  MINOR: update release.py
776ff95 is described below

commit 776ff95ae0f8cdd01aede21b95238738ff1db1b3
Author: Dong Lin <lindong28@gmail.com>
AuthorDate: Thu Jul 19 17:03:00 2018 -0700

    MINOR: update release.py
    
    Author: Dong Lin <lindong28@gmail.com>
    
    Reviewers: Matthias J. Sax <matthias@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io>
    
    Closes #5375 from lindong28/update-release-script
---
 release.py | 40 +++++++++++++++++++++++++---------------
 1 file changed, 25 insertions(+), 15 deletions(-)

diff --git a/release.py b/release.py
index a21ffdc..a335e8c 100755
--- a/release.py
+++ b/release.py
@@ -77,6 +77,7 @@ def print_output(output):
 def cmd(action, cmd, *args, **kwargs):
     if isinstance(cmd, basestring) and not kwargs.get("shell", False):
         cmd = cmd.split()
+    allow_failure = kwargs.pop("allow_failure", False)
 
     stdin_log = ""
     if "stdin" in kwargs and isinstance(kwargs["stdin"], basestring):
@@ -93,6 +94,9 @@ def cmd(action, cmd, *args, **kwargs):
     except subprocess.CalledProcessError as e:
         print_output(e.output)
 
+        if allow_failure:
+          return
+
         print("*************************************************")
         print("*** First command failure occurred here.      ***")
         print("*** Will now try to clean up working state.   ***")
@@ -126,9 +130,9 @@ def sftp_mkdir(dir):
     try:
        cmd_str  = """
 cd %s
-mkdir %s
+-mkdir %s
 """ % (basedir, dirname)
-       cmd("Creating '%s' in '%s' in your Apache home directory if it does not exist (errors
are ok if the directory already exists)" % (dirname, basedir), "sftp -b - %s@home.apache.org"
% apache_id, stdin=cmd_str)
+       cmd("Creating '%s' in '%s' in your Apache home directory if it does not exist (errors
are ok if the directory already exists)" % (dirname, basedir), "sftp -b - %s@home.apache.org"
% apache_id, stdin=cmd_str, allow_failure=True)
     except subprocess.CalledProcessError:
         # This is ok. The command fails if the directory already exists
         pass
@@ -243,13 +247,19 @@ apache_id = get_pref(prefs, 'apache_id', lambda: raw_input("Enter your
apache us
 
 jdk7_java_home = get_pref(prefs, 'jdk7', lambda: raw_input("Enter the path for JAVA_HOME
for a JDK7 compiler (blank to use default JAVA_HOME): "))
 jdk7_env = dict(os.environ) if jdk7_java_home.strip() else None
-if jdk7_env is not None: jdk7_env['JAVA_HOME'] = jdk7_java_home
+if jdk7_env is not None:
+    jdk7_env['JAVA_HOME'] = jdk7_java_home
+    jdk7_env['PATH'] = "%s/bin:%s" % (jdk7_java_home, jdk7_env['PATH'])
+
 if "1.7.0" not in cmd_output("java -version", env=jdk7_env):
     fail("You must be able to build artifacts with JDK7 for Scala 2.10 and 2.11 artifacts")
 
 jdk8_java_home = get_pref(prefs, 'jdk8', lambda: raw_input("Enter the path for JAVA_HOME
for a JDK8 compiler (blank to use default JAVA_HOME): "))
 jdk8_env = dict(os.environ) if jdk8_java_home.strip() else None
-if jdk8_env is not None: jdk8_env['JAVA_HOME'] = jdk8_java_home
+if jdk8_env is not None:
+    jdk8_env['JAVA_HOME'] = jdk8_java_home
+    jdk8_env['PATH'] = "%s/bin:%s" % (jdk8_java_home, jdk8_env['PATH'])
+
 if "1.8.0" not in cmd_output("java -version", env=jdk8_env):
     fail("You must be able to build artifacts with JDK8 for Scala 2.12 artifacts")
 
@@ -368,20 +378,20 @@ kafka_output_dir = "kafka-" + rc_tag
 sftp_mkdir(os.path.join("public_html", kafka_output_dir))
 public_release_dir = os.path.join("public_html", kafka_output_dir)
 # The sftp -r option doesn't seem to work as would be expected, at least with the version
shipping on OS X. To work around this we process all the files and directories manually...
-sftp_cmds = ""
+
 for root, dirs, files in os.walk(artifacts_dir):
     assert root.startswith(artifacts_dir)
 
-    for file in files:
-        local_path = os.path.join(root, file)
-        remote_path = os.path.join("public_html", kafka_output_dir, root[len(artifacts_dir)+1:],
file)
-        sftp_cmds += "\nput %s %s" % (local_path, remote_path)
-
     for dir in dirs:
         sftp_mkdir(os.path.join("public_html", kafka_output_dir, root[len(artifacts_dir)+1:],
dir))
 
-if sftp_cmds:
-    cmd("Uploading artifacts in %s to your Apache home directory" % root, "sftp -b - %s@home.apache.org"
% apache_id, stdin=sftp_cmds)
+    for file in files:
+        local_path = os.path.join(root, file)
+        remote_path = os.path.join("public_html", kafka_output_dir, root[len(artifacts_dir)+1:],
file)
+        sftp_cmds = """
+put %s %s
+""" % (local_path, remote_path)
+        cmd("Uploading artifacts in %s to your Apache home directory" % root, "sftp -b -
%s@home.apache.org" % apache_id, stdin=sftp_cmds)
 
 with open(os.path.expanduser("~/.gradle/gradle.properties")) as f:
     contents = f.read()
@@ -389,7 +399,7 @@ if not user_ok("Going to build and upload mvn artifacts based on these
settings:
     fail("Retry again later")
 cmd("Building and uploading archives", "./gradlew uploadArchivesAll", cwd=kafka_dir, env=jdk7_env)
 cmd("Building and uploading archives", "./gradlew uploadCoreArchives_2_12 -PscalaVersion=2.12",
cwd=kafka_dir, env=jdk8_env)
-cmd("Building and uploading archives", "mvn deploy", cwd=streams_quickstart_dir, env=jdk7_env)
+cmd("Building and uploading archives", "mvn deploy -Pgpg-signing", cwd=streams_quickstart_dir,
env=jdk7_env)
 
 release_notification_props = { 'release_version': release_version,
                                'rc': rc,
@@ -474,7 +484,7 @@ https://repository.apache.org/content/groups/staging/
 http://home.apache.org/~%(apache_id)s/kafka-%(rc_tag)s/javadoc/
 
 * Tag to be voted upon (off %(dev_branch)s branch) is the %(release_version)s tag:
-https://git-wip-us.apache.org/repos/asf?p=kafka.git;a=tag;h=%(rc_githash)s
+https://github.com/apache/kafka/releases/tag/%(rc_tag)s
 
 * Documentation:
 http://kafka.apache.org/%(docs_version)s/documentation.html
@@ -484,7 +494,7 @@ http://kafka.apache.org/%(docs_version)s/protocol.html
 
 * Successful Jenkins builds for the %(dev_branch)s branch:
 Unit/integration tests: https://builds.apache.org/job/kafka-%(dev_branch)s-jdk7/<BUILD
NUMBER>/
-System tests: https://jenkins.confluent.io/job/system-test-kafka-%(dev_branch)s/<BUILD_NUMBER>/
+System tests: https://jenkins.confluent.io/job/system-test-kafka/job/%(dev_branch)s/<BUILD_NUMBER>/
 
 /**************************************
 


Mime
View raw message