Skip to content

Instantly share code, notes, and snippets.

@kyrsideris
Created June 19, 2019 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyrsideris/8d3aa675927e1f478a8ed2ad95432c4b to your computer and use it in GitHub Desktop.
Save kyrsideris/8d3aa675927e1f478a8ed2ad95432c4b to your computer and use it in GitHub Desktop.
Checkout and build Confluent repos to install source locally
#/usr/bin/env bash
if [ $# -eq 0 ]; then
VERSION="v5.2.2"
else
VERSION="$1"
fi
clone_and_build () {
project_name="$1"
version="$2"
printf "Checking out '${project_name}' at version '${version}'\n"
if [ -d "${project_name}" ]; then
printf " Project's repo '${project_name}' already exists\n"
cd "${project_name}"
url="$(git remote -v | grep '(fetch)' | sed -E -e 's/[[:blank:]]+/ /g' | cut -d' ' -f2)"
if [ "$url" = "https://github.com/confluentinc/${project_name}.git" ]; then
printf " Project's remote was found correct, starting building it!\n"
git checkout "${version}"
mvn clean install source:jar
else
printf " Project's repo was not 'https://github.com/confluentinc/${project_name}.git', aborting... \n"
fi
cd ..
else
git clone --branch ${version} "https://github.com/confluentinc/${project_name}.git"
cd "${project_name}"
mvn clean install source:jar
cd ..
fi
}
clone_and_build common "${VERSION}"
clone_and_build kafka-connect-storage-common "${VERSION}"
clone_and_build rest-utils "${VERSION}"
clone_and_build schema-registry "${VERSION}"
clone_and_build kafka-connect-hdfs "${VERSION}"
clone_and_build kafka-connect-storage-cloud "${VERSION}"
printf "Finished all!'\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment