Skip to content

Instantly share code, notes, and snippets.

@MrSunshyne
Created May 28, 2020 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrSunshyne/53a89475e00ff3a98791061f26ec46cb to your computer and use it in GitHub Desktop.
Save MrSunshyne/53a89475e00ff3a98791061f26ec46cb to your computer and use it in GitHub Desktop.
Directus Operations
#!make
include .env
export $(shell sed 's/=.*//' .env)
build:
@echo "hi ${SOURCE_DATABASE_NAME}"
export:
@(docker exec -i ${SOURCE_CONTAINER_ID} mysqldump -u ${SOURCE_DATABASE_USERNAME} -p${SOURCE_DATABASE_PASSWORD} ${SOURCE_DATABASE_NAME}) > ../directusdb/dump.sql
import:
@docker exec -i ${TARGET_CONTAINER_ID} mysql -u${TARGET_DATABASE_USERNAME} -p${TARGET_DATABASE_PASSWORD} ${TARGET_DATABASE_NAME} < ../directusdb/dump.sql
@echo "Import done"
@MrSunshyne
Copy link
Author

requires a .env file with the variables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment