You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
911B

  1. #!/bin/bash
  2. SOURCE="${BASH_SOURCE[0]}"
  3. while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
  4. TARGET="$(readlink "$SOURCE")"
  5. if [[ $TARGET == /* ]]; then
  6. #echo "SOURCE '$SOURCE' is an absolute symlink to '$TARGET'"
  7. SOURCE="$TARGET"
  8. else
  9. DIR="$( dirname "$SOURCE" )"
  10. #echo "SOURCE '$SOURCE' is a relative symlink to '$TARGET' (relative to '$DIR')"
  11. SOURCE="$DIR/$TARGET" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
  12. fi
  13. done
  14. SRPATH="$( dirname "$SOURCE" )"
  15. SFPATH="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
  16. if [ "$SFPATH" != "$SRPATH" ]; then
  17. RDIR=$SRPATH # relativ path directory
  18. fi
  19. cwdir=$PWD
  20. wdir=$SFPATH
  21. if [ "$cwdir" != "$wdir" ]; then
  22. cd $wdir
  23. fi
  24. env nodepath=$PWD \
  25. docker-compose -f run.yml up -d
  26. #docker-compose -f run.yml up -d > /dev/null 2>&1
  27. cd $cwdir