hacks/ubuntu-makevm/2004/Makefile

31 lines
550 B
Makefile
Raw Normal View History

2020-02-20 04:26:02 +00:00
export VMNAME := ubuntu2004
2020-02-15 21:38:59 +00:00
export DISK_DIR := /storage/scratch/tmp
2020-02-20 04:26:02 +00:00
export THAT_DIR := /storage/admin/vms/2004
2020-02-15 21:38:59 +00:00
export HOST := las1.local
.PHONY: clean install reinstall rcopy rrun
default: remote
clean:
-virsh destroy $(VMNAME)
-virsh undefine $(VMNAME)
rm -f $(DISK_DIR)/$(VMNAME).qcow2
install:
bash install.sh
reinstall: clean install
remote: rrun
rcopy:
2020-02-20 04:26:02 +00:00
rsync -avP ./ root@$(HOST):/$(THAT_DIR)/
2020-02-15 21:38:59 +00:00
rrun: rcopy
2020-02-20 04:26:02 +00:00
ssh -t root@$(HOST) "cd /$(THAT_DIR) && make reinstall"
rclean: rcopy
ssh -t root@$(HOST) "cd /$(THAT_DIR) && make clean"