-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #786 from Altinity/update_docker_compose_start
Added logic to get latest release from github
- Loading branch information
Showing
2 changed files
with
60 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
# Replace with your GitHub repository (e.g., user/repo) | ||
REPO="altinity/clickhouse-sink-connector" | ||
|
||
# Fetch the latest release from GitHub API | ||
latest_release=$(curl -s https://api.github.com/repos/$REPO/releases/latest) | ||
|
||
# Also get the date of the latest release | ||
latest_release_date=$(echo $latest_release | jq -r '.published_at') | ||
|
||
# Extract the tag name (version) from the JSON response | ||
latest_version=$(echo $latest_release | jq -r '.tag_name') | ||
|
||
|
||
echo "****************************************************************************************************" | ||
# Display a message to the usage of the latest_version in color green | ||
echo -e "\e[32mThe latest release is: $latest_version published on: $latest_release_date\e[0m" | ||
# echo that the enviroment variable CLICKHOUSE_SINK_CONNECTOR_LT_IMAGE will be | ||
# set to the latest version | ||
echo "Setting CLICKHOUSE_SINK_CONNECTOR_LT_IMAGE to the latest version" | ||
# Display a message to the usage of the latest_version in color green | ||
echo -e "\e[32mCLICKHOUSE_SINK_CONNECTOR_LT_IMAGE=altinity/clickhouse-sink-connector:$latest_version-lt'\e[0m" | ||
|
||
#export CLICKHOUSE_SINK_CONNECTOR_LT_IMAGE='altinity/clickhouse-sink-connector:'$latest_version-lt | ||
export CLICKHOUSE_SINK_CONNECTOR_LT_IMAGE='altinity/clickhouse-sink-connector:'$latest_version-lt | ||
|
||
#echo run docker-compose up to start sink connector in green | ||
echo "\e[32mRun docker-compose up to start sink connector\e[0m" | ||
#Add stars | ||
echo "****************************************************************************************************" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,40 @@ | ||
#!/bin/bash | ||
|
||
|
||
# Replace with your GitHub repository (e.g., user/repo) | ||
REPO="altinity/clickhouse-sink-connector" | ||
|
||
# Fetch the latest release from GitHub API | ||
latest_release=$(curl -s https://api.github.com/repos/$REPO/releases/latest) | ||
|
||
# Also get the date of the latest release | ||
latest_release_date=$(echo $latest_release | jq -r '.published_at') | ||
|
||
# Extract the tag name (version) from the JSON response | ||
latest_version=$(echo $latest_release | jq -r '.tag_name') | ||
|
||
|
||
echo "****************************************************************************************************" | ||
# Display a message to the usage of the latest_version in color green | ||
echo -e "\e[32mThe latest release is: $latest_version published on: $latest_release_date\e[0m" | ||
# echo that the enviroment variable CLICKHOUSE_SINK_CONNECTOR_LT_IMAGE will be | ||
# set to the latest version | ||
echo "Setting CLICKHOUSE_SINK_CONNECTOR_LT_IMAGE to the latest version" | ||
# Display a message to the usage of the latest_version in color green | ||
echo -e "\e[32mCLICKHOUSE_SINK_CONNECTOR_LT_IMAGE=altinity/clickhouse-sink-connector:$latest_version-lt'\e[0m" | ||
|
||
#Add stars | ||
echo "****************************************************************************************************" | ||
sleep 5 | ||
if [ -z $1 ] | ||
then | ||
echo 'Using the latest tag for Sink connector' | ||
export CLICKHOUSE_SINK_CONNECTOR_LT_IMAGE='altinityinfra/clickhouse-sink-connector:408-97b1d3d83ef93c1b76a2b1c4d9c544dc67fbbec3' | ||
#echo 'Using the latest tag for Sink connector' | ||
export CLICKHOUSE_SINK_CONNECTOR_LT_IMAGE='altinity/clickhouse-sink-connector:'$latest_version-lt | ||
else | ||
export CLICKHOUSE_SINK_CONNECTOR_LT_IMAGE=$1 | ||
fi | ||
|
||
./stop-docker-compose.sh | ||
#./stop-docker-compose.sh | ||
# Altinity sink images are tagged daily with this tag yyyy-mm-dd(2022-07-19) | ||
|
||
docker-compose -f docker-compose-mysql.yml up --remove-orphans --force-recreate --renew-anon-volumes | ||
docker-compose up --renew-anon-volumes |