From 3fff6023602822531efdae30bc8ebf862967f1ef Mon Sep 17 00:00:00 2001 From: Friedrich Beckmann Date: Mon, 25 Jul 2022 17:55:39 +0200 Subject: Initial Commit --- VexRiscv/src/test/python/gcloud/try.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 VexRiscv/src/test/python/gcloud/try.py (limited to 'VexRiscv/src/test/python/gcloud/try.py') diff --git a/VexRiscv/src/test/python/gcloud/try.py b/VexRiscv/src/test/python/gcloud/try.py new file mode 100755 index 0000000..650beb4 --- /dev/null +++ b/VexRiscv/src/test/python/gcloud/try.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python + +from os import system +from sys import argv + +project = "ivory-infusion-209508" +zone = "europe-west1-b" +instance = "miaou" + +def local(cmd): + print(cmd) + system(cmd) + +def remote(cmd): + cmd = 'gcloud compute --project "{}" ssh --zone "{}" "{}" -- "{}"'.format(project, zone, instance, cmd) + print(cmd) + system(cmd) + +def localToRemote(source, target): + remote("rm -rf target") + cmd = 'gcloud compute --project "{}" scp --zone "{}" {} {}:{}'.format(project, zone, source, instance, target) + print(cmd) + system(cmd) + +#local("sbt test &") +local("python -c 'from os import system; system(\"(sbt test >> sbtTest.txt) &\")'") +#python -c 'from os import system; system("sbt test")' & -- cgit v1.2.3