|
714 | 714 |
|
715 | 715 | alias docker_exec='docker $dockerConfig exec -i ${containerHash} '
|
716 | 716 |
|
717 |
| -MACHINE_HOME="/machine_home/nancy_${containerHash}" |
718 |
| -docker_exec sh -c "mkdir $MACHINE_HOME && chmod a+w $MACHINE_HOME" |
719 |
| -docker_exec bash -c "ln -s /storage/ $MACHINE_HOME/storage" |
720 |
| -MACHINE_HOME="/machine_home/nancy_${containerHash}/storage" |
721 |
| -docker_exec sh -c "chmod a+w $MACHINE_HOME" |
722 |
| -docker_exec sh -c "chmod a+w /storage" |
723 |
| - |
724 |
| -echo "Move posgresql to high speed disk" |
725 |
| -docker_exec bash -c "sudo /etc/init.d/postgresql stop" |
726 |
| -sleep 2 # wait for postgres stopped |
727 |
| -docker_exec bash -c "sudo mkdir /storage/postgresql" |
728 |
| -docker_exec bash -c "sudo mv /var/lib/postgresql/* /storage/postgresql" |
729 |
| -docker_exec bash -c "rm -R /var/lib/postgresql" |
730 |
| -docker_exec bash -c "ln -s /storage/postgresql /var/lib/postgresql" |
731 |
| -docker_exec bash -c "sudo /etc/init.d/postgresql start" |
732 |
| -sleep 2 # wait for postgres started |
| 717 | +if [[ "$RUN_ON" = "localhost" ]]; then |
| 718 | + MACHINE_HOME="/machine_home/nancy_${containerHash}" |
| 719 | + docker_exec sh -c "mkdir $MACHINE_HOME && chmod a+w $MACHINE_HOME" |
| 720 | +elif [[ "$RUN_ON" = "aws" ]]; then |
| 721 | + MACHINE_HOME="/machine_home/nancy_${containerHash}" |
| 722 | + docker_exec sh -c "mkdir $MACHINE_HOME && chmod a+w $MACHINE_HOME" |
| 723 | + docker_exec bash -c "ln -s /storage/ $MACHINE_HOME/storage" |
| 724 | + MACHINE_HOME="/machine_home/nancy_${containerHash}/storage" |
| 725 | + docker_exec sh -c "chmod a+w $MACHINE_HOME" |
| 726 | + docker_exec sh -c "chmod a+w /storage" |
| 727 | + |
| 728 | + echo "Move posgresql to high speed disk" |
| 729 | + docker_exec bash -c "sudo /etc/init.d/postgresql stop" |
| 730 | + sleep 2 # wait for postgres stopped |
| 731 | + docker_exec bash -c "sudo mkdir /storage/postgresql" |
| 732 | + docker_exec bash -c "sudo mv /var/lib/postgresql/* /storage/postgresql" |
| 733 | + docker_exec bash -c "rm -R /var/lib/postgresql" |
| 734 | + docker_exec bash -c "ln -s /storage/postgresql /var/lib/postgresql" |
| 735 | + docker_exec bash -c "sudo /etc/init.d/postgresql start" |
| 736 | + sleep 2 # wait for postgres started |
| 737 | +else |
| 738 | + >&2 echo "ASSERT: must not reach this point" |
| 739 | + exit 1 |
| 740 | +fi |
733 | 741 |
|
734 | 742 | function copyFile() {
|
735 | 743 | if [ "$1" != '' ]; then
|
|
0 commit comments