VedarthConfluent commented on code in PR #14552:
URL: https://github.com/apache/kafka/pull/14552#discussion_r1393649057


##########
docker/docker_release.py:
##########
@@ -0,0 +1,80 @@
+#!/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.
+#
+
+"""
+Python script to build and push docker image
+Usage: docker_release.py
+
+Interactive utility to push the docker image to dockerhub
+"""
+
+import subprocess
+from distutils.dir_util import copy_tree
+from datetime import date
+import shutil
+
+def push_jvm(image, kafka_url):
+    copy_tree("resources", "jvm/resources")
+    subprocess.run(["docker", "buildx", "build", "-f", "jvm/Dockerfile", 
"--build-arg", f"kafka_url={kafka_url}", "--build-arg", 
f"build_date={date.today()}",
+    "--push",
+    "--platform", "linux/amd64,linux/arm64",
+    "--tag", image, "jvm"])
+    shutil.rmtree("jvm/resources")
+
+def login():
+    status = subprocess.run(["docker", "login"])
+    if status.returncode != 0:
+        print("Docker login failed, aborting the docker release")
+        raise PermissionError
+
+def create_builder():
+    subprocess.run(["docker", "buildx", "create", "--name", "kafka-builder", 
"--use"])
+
+def remove_builder():
+    subprocess.run(["docker", "buildx", "rm", "kafka-builder"])
+
+if __name__ == "__main__":

Review Comment:
   We have decided to keep the release and promotion process to be driven by 
local scripts for now



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to