Skip to content
Merged
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
5 changes: 3 additions & 2 deletions .github/workflows/reusable-ruby-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ jobs:

- name: Rewrite GitHub SSH URLs to HTTPS for Bundler
run: |
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://github.com/".insteadOf ssh://git@github.com/
git config --global --add url."https://github.com/".insteadOf git@github.com:
git config --global --add url."https://github.com/".insteadOf ssh://git@github.com/
git config --global --get-all url."https://github.com/".insteadOf

- uses: ruby/setup-ruby@v1
with:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/reusable-ruby-publish-migrated-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,40 @@ jobs:
echo $GITHUB_TOKEN | docker login ghcr.io -u $REPOSITORY_OWNER --password-stdin
docker commit --change "ENV PGDATA=/data" postgres ghcr.io/personaclick/postgres-migrated:latest
docker push ghcr.io/personaclick/postgres-migrated:latest

- name: Start clickhouse
run: |
docker stop clickhouse_server
docker run -d \
--name clickhouse \
-p 8123:8123 \
-p 9000:9000 \
-p 9009:9009 \
-p 9004:9004 \
-p 9005:9005 \
--ulimit nofile=262144:262144 \
clickhouse/clickhouse-server
docker cp ./config/clickhouse-config.xml clickhouse:/etc/clickhouse-server/config.xml

- name: Run clickhouse migrations
run: |
bundle exec rake clickhouse:create
bundle exec rake clickhouse:schema:load
docker exec clickhouse clickhouse-client --query="rename database personaclick to personaclick_test"
bundle exec rake clickhouse:create
bundle exec rake clickhouse:schema:load
docker exec clickhouse clickhouse-client --query="show databases"
docker exec clickhouse clickhouse-client --query="show tables from personaclick_test"
docker exec clickhouse clickhouse-client --query="show tables from personaclick"

- name: Publish clickhouse docker image
env:
REPOSITORY_OWNER: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker exec clickhouse cp -r /var/lib/clickhouse/. /data/
docker exec clickhouse sed -i 's|<path>/var/lib/clickhouse</path>|<path>/data</path>|g' /etc/clickhouse-server/config.xml
docker stop clickhouse
echo $GITHUB_TOKEN | docker login ghcr.io -u $REPOSITORY_OWNER --password-stdin
docker commit clickhouse ghcr.io/personaclick/clickhouse-migrated:latest
docker push ghcr.io/personaclick/clickhouse-migrated:latest
Loading