From ac218e6825e7f1b9d1778ad73b7315098aa13fd1 Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Sat, 26 Dec 2020 16:33:37 +0100 Subject: [PATCH] Fix build script + cleaning of OVH instance --- .gitignore | 1 + build_android.sh | 3 +-- out/.gitkeep | 0 ovh_orchestrator/__main__.py | 3 ++- run.sh | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 out/.gitkeep diff --git a/.gitignore b/.gitignore index 7acdc0a..9e85467 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ __pycache__ ovh_orchestrator/config.py +out/ diff --git a/build_android.sh b/build_android.sh index 840b877..922a9b8 100755 --- a/build_android.sh +++ b/build_android.sh @@ -133,5 +133,4 @@ fi # Build Lineage or /e/ (takes 2 to 3 hours!) croot make clean -date | tee build.log; brunch h870 | tee build.log; date | tee build.log -touch ~/BUILD_DONE +date | tee -a build.log && brunch h870 | tee -a build.log && date | tee -a build.log && touch ~/BUILD_DONE diff --git a/out/.gitkeep b/out/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ovh_orchestrator/__main__.py b/ovh_orchestrator/__main__.py index 65a7fac..23d2720 100644 --- a/ovh_orchestrator/__main__.py +++ b/ovh_orchestrator/__main__.py @@ -95,10 +95,11 @@ if __name__ == '__main__': '/cloud/project/' + config.ovh_public_cloud_project + '/instance', region=config.ovh_public_cloud_region, ) + print(result) instance_id = next( x['id'] for x in result - if sys.argv[2] in x['ipAddresses'] + if sys.argv[2] in [x['ip'] for x in x['ipAddresses']] ) # Delete instance diff --git a/run.sh b/run.sh index d8feebb..3fd7110 100755 --- a/run.sh +++ b/run.sh @@ -38,7 +38,7 @@ done set -e # Fetch back the built images -rsync -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" -azr --progress ubuntu@${IP_ADDRESS}:~/android/lineage/out/target/product/h870/\*.{zip,md5sum,img} . +#rsync -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" -azr --progress ubuntu@${IP_ADDRESS}:~/android/lineage/out/target/product/h870/\*.{zip,md5sum,img} out/ # Purge the OVH instance ./.venv/bin/python3 -m ovh_orchestrator purge ${IP_ADDRESS}