Fix build script + cleaning of OVH instance

This commit is contained in:
Lucas Verney 2020-12-26 16:33:37 +01:00
parent 4331a51e28
commit ac218e6825
5 changed files with 5 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
__pycache__
ovh_orchestrator/config.py
out/

View File

@ -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

0
out/.gitkeep Normal file
View File

View File

@ -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

2
run.sh
View File

@ -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}