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

Commit 8677940

Browse files
dmiusDmitry
authored andcommitted
Some fixes
1 parent 47aeecc commit 8677940

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

nancy_run.sh

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -665,10 +665,10 @@ elif [[ "$RUN_ON" = "aws" ]]; then
665665
fi
666666
echo "Docker $DOCKER_MACHINE is running."
667667

668-
echo "Attempt use high speed disk"
669668
docker-machine ssh $DOCKER_MACHINE "sudo sh -c \"mkdir /home/storage\""
670669
if [ ${AWS_EC2_TYPE:0:2} == 'i3' ]
671670
then
671+
echo "Attempt use high speed disk"
672672
# Init i3 storage, just mount existing volume
673673
echo "Attach i3 nvme volume"
674674
docker-machine ssh $DOCKER_MACHINE sudo add-apt-repository -y ppa:sbates
@@ -686,7 +686,8 @@ elif [[ "$RUN_ON" = "aws" ]]; then
686686
docker-machine ssh $DOCKER_MACHINE sudo mkfs -t ext4 /dev/nvme0n1p1
687687
docker-machine ssh $DOCKER_MACHINE sudo mount /dev/nvme0n1p1 /home/storage
688688
else
689-
# Create new volume and attach them for non i3 instances if need
689+
echo "Attempt use external disk"
690+
# Create new volume and attach them for non i3 instances if needed
690691
if [ ! -z ${EBS_SIZE+x} ]; then
691692
echo "Create and attach EBS volume"
692693
[ $DEBUG -eq 1 ] && echo "Create volume with size: $EBS_SIZE Gb"
@@ -714,29 +715,20 @@ fi
714715

715716
alias docker_exec='docker $dockerConfig exec -i ${containerHash} '
716717

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"
718+
MACHINE_HOME="/machine_home/nancy_${containerHash}"
719+
docker_exec sh -c "mkdir $MACHINE_HOME && chmod a+w $MACHINE_HOME"
720+
if [[ "$RUN_ON" = "aws" ]]; then
723721
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"
722+
MACHINE_HOME="$MACHINE_HOME/storage"
726723
docker_exec sh -c "chmod a+w /storage"
727724

728-
echo "Move posgresql to high speed disk"
725+
echo "Move posgresql to separated disk"
729726
docker_exec bash -c "sudo /etc/init.d/postgresql stop"
730727
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"
728+
docker_exec bash -c "sudo mv /var/lib/postgresql /storage/"
734729
docker_exec bash -c "ln -s /storage/postgresql /var/lib/postgresql"
735730
docker_exec bash -c "sudo /etc/init.d/postgresql start"
736731
sleep 2 # wait for postgres started
737-
else
738-
>&2 echo "ASSERT: must not reach this point"
739-
exit 1
740732
fi
741733

742734
function copyFile() {

0 commit comments

Comments
 (0)