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

Commit b56631b

Browse files
committed
remove additional layer in the path of tmp dir
1 parent 4c594a4 commit b56631b

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

nancy_run.sh

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,6 @@ function checkParams() {
343343
#make tmp path if not found
344344
[ ! -d $TMP_PATH ] && mkdir $TMP_PATH
345345

346-
if [ -z ${S3_CFG_PATH+x} ]
347-
then
348-
>&2 echo "WARNING: S3 config file path not given. Will use ~/.s3cfg"
349-
S3_CFG_PATH=$(echo ~)"/.s3cfg"
350-
fi
351-
352346
workloads_count=0
353347
[ ! -z ${WORKLOAD_BASIS_PATH+x} ] && let workloads_count=$workloads_count+1
354348
[ ! -z ${WORKLOAD_FULL_PATH+x} ] && let workloads_count=$workloads_count+1
@@ -525,10 +519,9 @@ function createDockerMachine() {
525519
}
526520

527521
if [[ "$RUN_ON" = "localhost" ]]; then
528-
mkdir "$TMP_PATH/pg_nancy_home"
529522
if [ -z ${CONTAINER_ID+x} ]; then
530523
containerHash=$(docker run --name="pg_nancy_${CURRENT_TS}" \
531-
-v $TMP_PATH/pg_nancy_home:/machine_home \
524+
-v $TMP_PATH:/machine_home \
532525
-dit "postgresmen/postgres-with-stuff:pg${PG_VERSION}" \
533526
)
534527
else
@@ -606,7 +599,7 @@ function cleanup {
606599
rm -f "$TMP_PATH/target_config_tmp.conf"
607600
rm -f "$TMP_PATH/pg_config_tmp.conf"
608601
if [ "$RUN_ON" = "localhost" ]; then
609-
rm -rf "$TMP_PATH/pg_nancy_home/${containerHash}"
602+
rm -rf "$TMP_PATH/nancy_${containerHash}"
610603
echo "Remove docker container"
611604
docker container rm -f $containerHash
612605
elif [ "$RUN_ON" = "aws" ]; then
@@ -621,20 +614,16 @@ trap cleanup EXIT
621614

622615
alias docker_exec='docker $dockerConfig exec -i ${containerHash} '
623616

624-
if [[ "$RUN_ON" = "localhost" ]]; then
625-
MACHINE_HOME="/machine_home/${containerHash}"
626-
mkdir $TMP_PATH/pg_nancy_home/${containerHash}
627-
else
628-
MACHINE_HOME="/machine_home"
629-
fi
617+
MACHINE_HOME="/machine_home/nancy_${containerHash}"
618+
docker_exec sh -c "mkdir $MACHINE_HOME && chmod a+w $MACHINE_HOME"
630619

631620
function copyFile() {
632621
if [ "$1" != '' ]; then
633622
if [[ "$1" =~ "s3://" ]]; then # won't work for .s3cfg!
634623
docker_exec s3cmd sync $1 $MACHINE_HOME/
635624
else
636625
if [ "$RUN_ON" = "localhost" ]; then
637-
ln ${1/file:\/\//} "$TMP_PATH/pg_nancy_home/$containerHash/" # TODO: option – hard links OR regular `cp`
626+
ln ${1/file:\/\//} "$TMP_PATH/nancy_$containerHash/" # TODO: option – hard links OR regular `cp`
638627
elif [ "$RUN_ON" = "aws" ]; then
639628
docker-machine scp $1 $DOCKER_MACHINE:/home/ubuntu
640629
else
@@ -728,8 +717,8 @@ else
728717
| grep / | sed -e 's/^[ \t]*//'")
729718
docker_exec bash -c "gzip -c $logpath > $MACHINE_HOME/$ARTIFACTS_FILENAME.log.gz"
730719
if [ "$RUN_ON" = "localhost" ]; then
731-
cp "$TMP_PATH/pg_nancy_home/$containerHash/"$ARTIFACTS_FILENAME.json $ARTIFACTS_DESTINATION/
732-
cp "$TMP_PATH/pg_nancy_home/$containerHash/"$ARTIFACTS_FILENAME.log.gz $ARTIFACTS_DESTINATION/
720+
cp "$TMP_PATH/nancy_$containerHash/"$ARTIFACTS_FILENAME.json $ARTIFACTS_DESTINATION/
721+
cp "$TMP_PATH/nancy_$containerHash/"$ARTIFACTS_FILENAME.log.gz $ARTIFACTS_DESTINATION/
733722
elif [ "$RUN_ON" = "aws" ]; then
734723
docker-machine scp $DOCKER_MACHINE:/home/ubuntu/$ARTIFACTS_FILENAME.json $ARTIFACTS_DESTINATION/
735724
docker-machine scp $DOCKER_MACHINE:/home/ubuntu/$ARTIFACTS_FILENAME.log.gz $ARTIFACTS_DESTINATION/

0 commit comments

Comments
 (0)