deployment-dcdn/bin/import_directus_schema.sh

17 lines
527 B
Bash
Raw Normal View History

2024-05-03 17:19:46 +02:00
#!/bin/bash
. bin/variables.sh
. bin/functions.sh
get_username
get_ip
get_ssh_port
echo -e "${PURPLE}${BOLD}Import local Directus data model${RESET}"
echo -e "${BLUE}npx directus schema snapshot ./snapshot.yaml${RESET}"
echo -e "${BLUE}scp -P ${ssh_port} /local/path/to/snapshot.yaml ${username}@${ip}:/home/${username}/snapshot.yaml${RESET}"
echo -e "${PURPLE}${BOLD}Press any key when done${RESET}"
read
su -s /bin/bash -c "cd ${CMS_DIRECTORY} &&\
npx directus schema apply --yes /home/${username}/snapshot.yaml" www-data