mirror of
https://github.com/frappe/bench.git
synced 2024-11-11 15:51:03 +00:00
fix: ubuntu iso version and packer path
This commit is contained in:
parent
ae9cef3f54
commit
064fb66280
10
vm/build.py
10
vm/build.py
@ -33,14 +33,14 @@ def install_virtualbox():
|
||||
check_output(['bench', 'install', 'virtualbox'])
|
||||
|
||||
def install_packer():
|
||||
if not os.path.exists(os.path.join('/', 'opt', 'packer')):
|
||||
if not spawn.find_executable("packer") or not os.path.exists(os.path.join('/', 'opt', 'packer')):
|
||||
check_output(['bench', 'install', 'packer'])
|
||||
|
||||
def silent_remove(name, is_dir=False):
|
||||
'''
|
||||
Method to safely remove a file or directory,
|
||||
without throwing error if file doesn't exist
|
||||
|
||||
|
||||
By default takes in file as input, for directory:
|
||||
is_dir = True
|
||||
'''
|
||||
@ -59,8 +59,8 @@ def cleanup():
|
||||
silent_remove("packer_virtualbox-iso_virtualbox-iso_md5.checksum")
|
||||
|
||||
def build_vm():
|
||||
check_output(["/opt/packer", "build", "vm-production.json"])
|
||||
check_output(["/opt/packer", "build", "vm-develop.json"])
|
||||
check_output(["packer", "build", "vm-production.json"])
|
||||
check_output(["packer", "build", "vm-develop.json"])
|
||||
|
||||
def md5(build, file):
|
||||
return check_output("md5sum '{} Builds/{}'".format(build, file), shell=True).split()[0]
|
||||
@ -116,7 +116,7 @@ def delete_old_vms():
|
||||
silent_remove(os.path.join(PUBLIC_DIR, 'BACKUPS'), is_dir=True)
|
||||
|
||||
def move_current_vms():
|
||||
os.mkdir(os.path.join(PUBLIC_DIR, 'BACKUPS'))
|
||||
os.mkdir(os.path.join(PUBLIC_DIR, 'BACKUPS'))
|
||||
for file in os.listdir(PUBLIC_DIR):
|
||||
if file in NEW_FILES or file in SYMLINKS or file == 'BACKUPS':
|
||||
continue
|
||||
|
@ -33,8 +33,8 @@
|
||||
"format": "ova",
|
||||
"guest_os_type": "Ubuntu_64",
|
||||
"headless": true,
|
||||
"iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.4-server-amd64.iso",
|
||||
"iso_checksum": "6a7f31eb125a0b2908cf2333d7777c82",
|
||||
"iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.6-server-amd64.iso",
|
||||
"iso_checksum": "ac8a79a86a905ebdc3ef3f5dd16b7360",
|
||||
"iso_checksum_type": "md5",
|
||||
"ssh_username": "frappe",
|
||||
"ssh_password": "frappe",
|
||||
|
@ -33,8 +33,8 @@
|
||||
"format": "ova",
|
||||
"guest_os_type": "Ubuntu_64",
|
||||
"headless": true,
|
||||
"iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.4-server-amd64.iso",
|
||||
"iso_checksum": "6a7f31eb125a0b2908cf2333d7777c82",
|
||||
"iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.6-server-amd64.iso",
|
||||
"iso_checksum": "ac8a79a86a905ebdc3ef3f5dd16b7360",
|
||||
"iso_checksum_type": "md5",
|
||||
"ssh_username": "frappe",
|
||||
"ssh_password": "frappe",
|
||||
|
Loading…
Reference in New Issue
Block a user