Skip to content

Commit

Permalink
update deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouop0 committed Sep 20, 2024
1 parent ddcd1ec commit 3d98d93
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 33 deletions.
9 changes: 2 additions & 7 deletions deploy/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ source:
password: root
database: dispute_explorer
meilisearch:
api_url: http://localhost:7701
api_key: 2b85b8c251421e43808ee9e20e34e6b001268cee726845d3ba9b40a83fa728e9
api_url: http://localhost:7700
api_key: 56313adcb3ebc9220c6b225f7a17d4a1f84183a64ddecac62d179486ed1f0114
sync:
- table: dispute_game
index: disputegames
Expand Down Expand Up @@ -60,8 +60,3 @@ sync:
- table: sync_events
index: syncevents
full: true





26 changes: 0 additions & 26 deletions deploy/docker-compose-meiliSearch.yml

This file was deleted.

27 changes: 27 additions & 0 deletions deploy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
image: mysql:8.0.28
environment:
MYSQL_ROOT_PASSWORD: "root"
restart: always
ports:
- "3367:3306"
volumes:
Expand All @@ -23,6 +24,32 @@ services:
- ../.env
network_mode: host

meiliSearch:
container_name: meilisearch
image: getmeili/meilisearch:v1.8
restart: always
depends_on:
- mysql
- node1
environment:
- MEILI_MASTER_KEY=123456
ports:
- "7700:7700"
volumes:
- ./meili_data:/meili_data

meiliSync:
platform: linux/x86_64
image: long2ice/meilisync:sha-fc1877d
restart: on-failure
depends_on:
- mysql
- node1
- meiliSearch
volumes:
- ./config.yml:/meilisync/config.yml
network_mode: host




15 changes: 15 additions & 0 deletions deploy/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

docker-compose -f docker-compose.yml up -d

sleep 5

# Bearer Token
bearer_token="123456"

curl_response=$(curl -s -H "Authorization: Bearer $bearer_token" http://localhost:7700/keys)
new_api_key=$(echo "$curl_response" | jq -r '.results[] | select(.actions[] | contains("*")) | .key')

yq e ".meilisearch.api_key = \"$new_api_key\"" -i config.yml

echo "api_key was successfully updated to: $new_api_key"
3 changes: 3 additions & 0 deletions deploy/stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

docker-compose -f docker-compose.yml down

0 comments on commit 3d98d93

Please sign in to comment.