mirror of
https://github.com/frappe/bench.git
synced 2025-01-24 23:48:24 +00:00
commit
3dbb412e3c
10
vm/build.py
10
vm/build.py
@ -33,14 +33,14 @@ def install_virtualbox():
|
|||||||
check_output(['bench', 'install', 'virtualbox'])
|
check_output(['bench', 'install', 'virtualbox'])
|
||||||
|
|
||||||
def install_packer():
|
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'])
|
check_output(['bench', 'install', 'packer'])
|
||||||
|
|
||||||
def silent_remove(name, is_dir=False):
|
def silent_remove(name, is_dir=False):
|
||||||
'''
|
'''
|
||||||
Method to safely remove a file or directory,
|
Method to safely remove a file or directory,
|
||||||
without throwing error if file doesn't exist
|
without throwing error if file doesn't exist
|
||||||
|
|
||||||
By default takes in file as input, for directory:
|
By default takes in file as input, for directory:
|
||||||
is_dir = True
|
is_dir = True
|
||||||
'''
|
'''
|
||||||
@ -59,8 +59,8 @@ def cleanup():
|
|||||||
silent_remove("packer_virtualbox-iso_virtualbox-iso_md5.checksum")
|
silent_remove("packer_virtualbox-iso_virtualbox-iso_md5.checksum")
|
||||||
|
|
||||||
def build_vm():
|
def build_vm():
|
||||||
check_output(["/opt/packer", "build", "vm-production.json"])
|
check_output(["packer", "build", "vm-production.json"])
|
||||||
check_output(["/opt/packer", "build", "vm-develop.json"])
|
check_output(["packer", "build", "vm-develop.json"])
|
||||||
|
|
||||||
def md5(build, file):
|
def md5(build, file):
|
||||||
return check_output("md5sum '{} Builds/{}'".format(build, file), shell=True).split()[0]
|
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)
|
silent_remove(os.path.join(PUBLIC_DIR, 'BACKUPS'), is_dir=True)
|
||||||
|
|
||||||
def move_current_vms():
|
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):
|
for file in os.listdir(PUBLIC_DIR):
|
||||||
if file in NEW_FILES or file in SYMLINKS or file == 'BACKUPS':
|
if file in NEW_FILES or file in SYMLINKS or file == 'BACKUPS':
|
||||||
continue
|
continue
|
||||||
|
@ -33,8 +33,8 @@
|
|||||||
"format": "ova",
|
"format": "ova",
|
||||||
"guest_os_type": "Ubuntu_64",
|
"guest_os_type": "Ubuntu_64",
|
||||||
"headless": true,
|
"headless": true,
|
||||||
"iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.4-server-amd64.iso",
|
"iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.6-server-amd64.iso",
|
||||||
"iso_checksum": "6a7f31eb125a0b2908cf2333d7777c82",
|
"iso_checksum": "ac8a79a86a905ebdc3ef3f5dd16b7360",
|
||||||
"iso_checksum_type": "md5",
|
"iso_checksum_type": "md5",
|
||||||
"ssh_username": "frappe",
|
"ssh_username": "frappe",
|
||||||
"ssh_password": "frappe",
|
"ssh_password": "frappe",
|
||||||
|
@ -33,8 +33,8 @@
|
|||||||
"format": "ova",
|
"format": "ova",
|
||||||
"guest_os_type": "Ubuntu_64",
|
"guest_os_type": "Ubuntu_64",
|
||||||
"headless": true,
|
"headless": true,
|
||||||
"iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.4-server-amd64.iso",
|
"iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.6-server-amd64.iso",
|
||||||
"iso_checksum": "6a7f31eb125a0b2908cf2333d7777c82",
|
"iso_checksum": "ac8a79a86a905ebdc3ef3f5dd16b7360",
|
||||||
"iso_checksum_type": "md5",
|
"iso_checksum_type": "md5",
|
||||||
"ssh_username": "frappe",
|
"ssh_username": "frappe",
|
||||||
"ssh_password": "frappe",
|
"ssh_password": "frappe",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user