Skip to content

Commit

Permalink
Added logic to replace docker build tag
Browse files Browse the repository at this point in the history
  • Loading branch information
subkanthi committed Jul 22, 2024
1 parent e7e4d5b commit 4d865fb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
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

0 comments on commit 4d865fb

Please sign in to comment.