17 lines
527 B
Bash
17 lines
527 B
Bash
#!/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 |