diff --git a/externals b/externals index 2ddd46715..d04f2ff8a 160000 --- a/externals +++ b/externals @@ -1 +1 @@ -Subproject commit 2ddd4671513460faf006cd89a851937575cbc9c3 +Subproject commit d04f2ff8a5237d563d87769a33e6d3542b47f199 diff --git a/tools/replicator/replicate_to_linux_vm.py b/tools/replicator/replicate_to_linux_vm.py new file mode 100644 index 000000000..64bc8534c --- /dev/null +++ b/tools/replicator/replicate_to_linux_vm.py @@ -0,0 +1,43 @@ +from shutil import copyfile +import os, sys, subprocess, time + +spark_profile = \ +'''\ +root = $SOURCE +root = socket://192.168.99.100:8080/$TARGET +ignore = Path build +ignore = Path .git +ignore = Path externals +ignore = Path docker +ignore = Regex .*\.pyc +ignore = Path x64 +repeat = watch +batch = true +force = $SOURCE +confirmbigdel = false +ignorearchives = true +''' + +this_path = os.path.realpath(__file__) +repo_root = os.path.abspath(os.path.dirname(this_path)) +repo_root = os.path.join(repo_root,os.pardir) +repo_root = os.path.join(repo_root,os.pardir) +repo_root = os.path.abspath(repo_root) + +repo_name = os.path.basename(repo_root) +profile_loc = os.path.join(os.path.abspath(os.environ['USERPROFILE']),'.unison') +spark_profile = spark_profile.replace("$SOURCE", repo_root) +spark_profile = spark_profile.replace("$TARGET", repo_name) + +unison_exe = os.path.join(repo_root,"externals","windows","bin","unison.exe") + + +if not os.path.exists(profile_loc): + os.mkdir(profile_loc) + +with open(os.path.join(profile_loc,repo_name), "w") as text_file: + text_file.write(spark_profile) + +while True: + subprocess.call((unison_exe,repo_name)) + time.sleep(10) diff --git a/tools/spark_vm_shell.sh b/tools/spark_vm_shell.sh new file mode 100644 index 000000000..bcb2850c6 --- /dev/null +++ b/tools/spark_vm_shell.sh @@ -0,0 +1,23 @@ +#/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +docker run \ + --rm \ + -i \ + -p 8000:8000 \ + -p 8001:8001 \ + -p 8080:8080 \ + --net host \ + -v /etc/passwd:/etc/passwd \ + -v /etc/group:/etc/group \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + -h $(hostname)_spark \ + -w $PWD \ + -u $UID \ + -v /home:/home \ + -e DISPLAY=$DISPLAY \ + -t bluetradingsystems/linux_docker \ + /bin/bash -c "(cd ~/config && python -m SimpleHTTPServer >/dev/null 2>/dev/null) & (cd ~ && $DIR/../externals/linux/bin/unison -socket 8080) & /bin/bash" + +