Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit 819e086

Browse files
dmiusDmitry
authored andcommitted
Localhost branch fix
1 parent 842f762 commit 819e086

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

nancy_run.sh

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -714,22 +714,30 @@ fi
714714

715715
alias docker_exec='docker $dockerConfig exec -i ${containerHash} '
716716

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
733741

734742
function copyFile() {
735743
if [ "$1" != '' ]; then

0 commit comments

Comments
 (0)