-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
21 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
db/ | ||
|
||
.env | ||
.env.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,14 +11,23 @@ export REMOTE_IP=$( ssh ${REMOTE_USERNAME}@${REMOTE_HOSTNAME} docker inspect cap | |
echo "REMOTE_IP: ${REMOTE_IP}" | ||
|
||
# obtaining mysql password | ||
export MYSQL_PASSWORD=$( ssh [email protected] "grep CAPS_DB_PASSWORD docker/caps-matematica/caps.env" | cut -f2 -d= ) | ||
export MYSQL_PASSWORD=$( ssh ${REMOTE_USERNAME}@${REMOTE_HOSTNAME} "grep CAPS_DB_PASSWORD docker/caps-matematica/caps.env" | cut -f2 -d= ) | ||
echo "MYSQL_PASSWORD:" $(echo ${MYSQL_PASSWORD} | wc -c) "chars" | ||
|
||
# open port forwarding and run js import script migrate-mysql.js | ||
echo "opening ssh tunnel" | ||
ssh -N -L 3306:${REMOTE_IP}:3306 [email protected] & | ||
pidof_ssh=$! | ||
|
||
function cleanup { | ||
echo "closing ssh tunnel " | ||
kill ${pidof_ssh} | ||
} | ||
|
||
trap cleanup EXIT | ||
|
||
sleep 1 | ||
echo "start js script" | ||
node migrate-mysql.js | ||
|
||
kill ${pidof_ssh} | ||
#kill ${pidof_ssh} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters