fix(ci): mysql ddl apply (#1872)

main
junwen-lee 2 months ago committed by GitHub
parent 56ce8a0131
commit dcec20d9fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      docker/docker-compose.yml

@ -18,7 +18,7 @@ services:
volumes:
- ./data/mysql:/var/lib/mysql
- ./volumes/mysql/schema.sql:/docker-entrypoint-initdb.d/init.sql
- ./atlas/migrations:/atlas-migrations:ro
- ./atlas/opencoze_latest_schema.hcl:/opencoze_latest_schema.hcl:ro
entrypoint:
- bash
- -c
@ -56,7 +56,7 @@ services:
if [ -d '/atlas-migrations' ] && [ "$$(ls -A /atlas-migrations)" ]; then
echo 'Running Atlas migrations...'
ATLAS_URL="mysql://$${MYSQL_USER}:$${MYSQL_PASSWORD}@localhost:3306/$${MYSQL_DATABASE}"
atlas migrate apply --url "$$ATLAS_URL" --dir "file:///atlas-migrations" --allow-dirty
atlas schema apply -u "$ATLAS_URL" --to "file:///opencoze_latest_schema.hcl" --auto-approve
echo 'Atlas migrations completed successfully'
else
echo 'No migrations found'

Loading…
Cancel
Save