Skip to content

Commit

Permalink
build: remove release related files from ksql (#8739)
Browse files Browse the repository at this point in the history
* chore: add changes needed to make 0.23 release work

* chore: promote prod images to dockerhub

* chore: remove unused comment

* chore: remove unused settings file

* style: refactor names for clarity

* remove files from ksql that should be in release repo

* merge conflicts

* merge conflicts

* pin docker upstream tag

* add maven-settings with maven s3 url
  • Loading branch information
nateab authored Feb 9, 2022
1 parent f3a4a8d commit d341759
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 312 deletions.
46 changes: 46 additions & 0 deletions maven-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>release</id>

<activation>
<activeByDefault>true</activeByDefault>
</activation>

<repositories>
<repository>
<id>confluent-other</id>
<name>Confluent</name>
<url>https://ksqldb-maven.s3.amazonaws.com/maven/</url>
</repository>

<!-- needed for HTML API doc generation post-release only -->
<repository>
<id>ksqldb-staging</id>
<name>ksqlDB staging</name>
<url>https://ksqldb-maven.s3.amazonaws.com/maven/</url>
</repository>
</repositories>

<pluginRepositories>

<pluginRepository>
<id>confluent-other</id>
<name>Confluent Plugin Repository</name>
<url>https://ksqldb-maven.s3.amazonaws.com/maven/</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>

</pluginRepositories>
</profile>
</profiles>
</settings>
34 changes: 16 additions & 18 deletions release_stabilization.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import shlex
from collections import OrderedDict

DOCKER_REGISTRY = "confluent-docker-internal-stabilization.jfrog.io/"
DOCKER_INTERNAL_REGISTRY = "confluent-docker-internal.jfrog.io/"
DOCKER_UPSTREAM_REGISTRY = "confluent-docker.jfrog.io/"
DOCKER_REGISTRY = "confluent-docker.jfrog.io/"
CC_SPEC_KSQL_BRANCH = "master"
CCLOUD_DOCKER_REPO = 'confluentinc/cc-ksql'
CCLOUD_DOCKER_HOTFIX_REPO = 'confluentinc/cc-ksql-hotfix'
Expand All @@ -19,19 +18,18 @@ class Callbacks:
def __init__(self, working_dir, leaf, dry_run):
self.leaf = leaf
self.working_dir = working_dir
self.settings_path = os.path.join(self.working_dir, 'stabilization_settings.xml')

"""This is a callback to Confluent's cloud release tooling,
and allows us to have consistent versioning"""
def version_as_leaf(self):
return self.leaf == 'cc-docker-ksql'

def maven_build_args(self):
build_args = ["-gs", f"{self.settings_path}", "-DskipTests", "-DskipIntegrationTests", "-DversionFilter=true", "-U", "-Dspotbugs.skip", "-Dcheckstyle.skip"]
build_args = ["-DskipTests", "-DskipIntegrationTests", "-DversionFilter=true", "-U", "-Dspotbugs.skip", "-Dcheckstyle.skip"]
return build_args

def maven_deploy_args(self):
deploy_args = ["-gs", f"{self.settings_path}", "-DskipIntegrationTests", "-DversionFilter=true", "-U", "-DskipTests"]
deploy_args = ["-DskipTests", "-DskipIntegrationTests", "-DversionFilter=true", "-U"]
return deploy_args

def maven_docker_build(self):
Expand All @@ -40,8 +38,8 @@ def maven_docker_build(self):
# defaults docker.tag to be version created by stabilization
# mvn_docker_args["docker.tag"] =

mvn_docker_args["docker.registry"] = DOCKER_UPSTREAM_REGISTRY
mvn_docker_args["docker.test-registry"] = DOCKER_UPSTREAM_REGISTRY
mvn_docker_args["docker.registry"] = DOCKER_REGISTRY
mvn_docker_args["docker.test-registry"] = DOCKER_REGISTRY
mvn_docker_args["docker.upstream-registry"] = ""
mvn_docker_args["docker.upstream-tag"] = "7.0.1"
mvn_docker_args["skip.docker.build"] = "false"
Expand All @@ -56,31 +54,31 @@ def after_publish(self, version: str) -> bool:
if "rc" not in version:
# promote production images to dockerhub
for docker_repo in DOCKER_REPOS:
print(f"docker pull {DOCKER_UPSTREAM_REGISTRY}{docker_repo}:{version}")
subprocess.run(shlex.split(f"docker pull {DOCKER_UPSTREAM_REGISTRY}{docker_repo}:{version}"))
print(f"docker pull {DOCKER_REGISTRY}{docker_repo}:{version}")
subprocess.run(shlex.split(f"docker pull {DOCKER_REGISTRY}{docker_repo}:{version}"))

print(f"docker tag {DOCKER_UPSTREAM_REGISTRY}{docker_repo}:{version} {docker_repo}:{version}")
subprocess.run(shlex.split(f"docker tag {DOCKER_UPSTREAM_REGISTRY}{docker_repo}:{version} {docker_repo}:{version}"))
print(f"docker tag {DOCKER_REGISTRY}{docker_repo}:{version} {docker_repo}:{version}")
subprocess.run(shlex.split(f"docker tag {DOCKER_REGISTRY}{docker_repo}:{version} {docker_repo}:{version}"))
print(f"docker push {docker_repo}:{version}")
subprocess.run(shlex.split(f"docker push {docker_repo}:{version}"))

# update latest tag images on dockerhub
print(f"docker tag {DOCKER_UPSTREAM_REGISTRY}{docker_repo}:{version} {docker_repo}:latest")
subprocess.run(shlex.split(f"docker tag {DOCKER_UPSTREAM_REGISTRY}{docker_repo}:{version} {docker_repo}:latest"))
print(f"docker tag {DOCKER_REGISTRY}{docker_repo}:{version} {docker_repo}:latest")
subprocess.run(shlex.split(f"docker tag {DOCKER_REGISTRY}{docker_repo}:{version} {docker_repo}:latest"))
print(f"docker push {docker_repo}:latest")
subprocess.run(shlex.split(f"docker push {docker_repo}:latest"))

# pull, tag, and push latest docker on-prem images
for docker_repo in DOCKER_REPOS:
print(f"docker tag {DOCKER_UPSTREAM_REGISTRY}{DOCKER_ARTIFACT}:{version} {DOCKER_INTERNAL_REGISTRY}{docker_repo}:{version}")
subprocess.run(shlex.split(f"docker tag {DOCKER_UPSTREAM_REGISTRY}{DOCKER_ARTIFACT}:{version} {DOCKER_INTERNAL_REGISTRY}{docker_repo}:{version}"))
print(f"docker tag {DOCKER_REGISTRY}{DOCKER_ARTIFACT}:{version} {DOCKER_INTERNAL_REGISTRY}{docker_repo}:{version}")
subprocess.run(shlex.split(f"docker tag {DOCKER_REGISTRY}{DOCKER_ARTIFACT}:{version} {DOCKER_INTERNAL_REGISTRY}{docker_repo}:{version}"))
print(f"docker push {DOCKER_INTERNAL_REGISTRY}{docker_repo}:{version}")
subprocess.run(shlex.split(f"docker push {DOCKER_INTERNAL_REGISTRY}{docker_repo}:{version}"))

# clone kafka tutorials and checkout 'ksqldb-latest'
git_cmd_kafka_tutorial = f"git --git-dir={self.working_dir}/kafka-tutorials/.git --work-tree={self.working_dir}/kafka-tutorials"
print(f"{git_cmd_kafka_tutorial}")

# clone kafka tutorials and checkout 'ksqldb-latest'
kafka_tutorials_cwd = os.path.join(self.working_dir, 'kafka-tutorials')
print(f"{kafka_tutorials_cwd}")

Expand All @@ -94,8 +92,8 @@ def after_publish(self, version: str) -> bool:
print(f"{kafka_tutorials_cwd}")
print(f"{self.working_dir}")
update_ksqldb_version_path = os.path.join(self.working_dir, 'kafka-tutorials/tools/update-ksqldb-version.sh')
print(f"{update_ksqldb_version_path} {version} {DOCKER_UPSTREAM_REGISTRY}")
subprocess.run(shlex.split(f"{update_ksqldb_version_path} {version} {DOCKER_UPSTREAM_REGISTRY}"))
print(f"{update_ksqldb_version_path} {version} {DOCKER_REGISTRY}")
subprocess.run(shlex.split(f"{update_ksqldb_version_path} {version} {DOCKER_REGISTRY}"))

print(f"{git_cmd_kafka_tutorial} diff")
subprocess.run(shlex.split(f"{git_cmd_kafka_tutorial} diff"), cwd=kafka_tutorials_cwd)
Expand Down
143 changes: 0 additions & 143 deletions scripts/release/build-packages.sh

This file was deleted.

Loading

0 comments on commit d341759

Please sign in to comment.