build-remote 730 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env bash
  2. #
  3. #
  4. #
  5. #REMOTE_HOST="vm-fedora33"
  6. # Manual
  7. #BUILD_DIR="$PWD"
  8. #REMOTE_COMMAND="cd $PWD && ./script.sh"
  9. # VSCode
  10. #REMOTE_HOST="vm-fedora33"
  11. #BUILD_DIR=${fileWorkspaceFolder}
  12. #REMOTE_CMD="cd ${fileWorkspaceFolder} && chmod +x ${file} && ${file}"
  13. # Copy local directory "$2" to remote host "$1" and run the remaining commands
  14. ssh "$1" mkdir -p "$2"
  15. # Maybe use --delete for a cleaner dev env
  16. rsync -a "$2/" "$1":"$2"
  17. # We want this to expand on the client so we can pass our arguments to the remote
  18. # shellcheck disable=SC2029
  19. ssh "$1" "${@:2}"
  20. # exec_remote "$REMOTE_HOST" "$BUILD_DIR" "$REMOTE_CMD"
  21. #exec_remote vm-fedora33 ${fileWorkspaceFolder} cd ${fileWorkspaceFolder} && chmod +x ${file} && ${file}