Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added logic to replace docker build tag #703

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ jobs:
run: |
docker build . --file sink-connector-lightweight/Dockerfile --tag altinityinfra/clickhouse-sink-connector:${{ env.IMAGE_TAG }}-lt
docker save altinityinfra/clickhouse-sink-connector:${{ env.IMAGE_TAG }}-lt | gzip > clickhouse-sink-connector_${{ env.IMAGE_TAG }}-lt.tar.gz
# use sed to replace the image tag in docker/start-docker-compose.sh.template and copy it over to start-docker-compose.sh
sed -i "s/IMAGE_TAG/${{ env.IMAGE_TAG }}-lt/g" sink-connector-lightweight/docker/start-docker-compose.sh.template
cp sink-connector-lightweight/docker/start-docker-compose.sh.template sink-connector-lightweight/docker/start-docker-compose.sh
# commit the file to git
git add sink-connector-lightweight/docker/start-docker-compose.sh
git commit -m "Update image tag in start-docker-compose.sh"
git push

- name: Upload Docker tar (Lightweight)
uses: actions/upload-artifact@v3
Expand Down
15 changes: 15 additions & 0 deletions sink-connector-lightweight/docker/start-docker-compose.sh.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash


if [ -z $1 ]
then
echo 'Using the latest tag for Sink connector'
export CLICKHOUSE_SINK_CONNECTOR_LT_IMAGE='altinityinfra/clickhouse-sink-connector:IMAGE_TAG'
else
export CLICKHOUSE_SINK_CONNECTOR_LT_IMAGE=$1
fi

./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
Loading