Created
June 19, 2019 08:59
-
-
Save kyrsideris/8d3aa675927e1f478a8ed2ad95432c4b to your computer and use it in GitHub Desktop.
Checkout and build Confluent repos to install source locally
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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