mechboxes / mech

Easy command line virtual machines for VMWare
https://mechboxes.github.io/mech/
MIT License
311 stars 49 forks source link

Provision Shell Script #46

Closed wsc96 closed 2 years ago

wsc96 commented 6 years ago

Is there any documentation on the provision feature or a sample Mechfile that I can reference to do things like a provision shell script?

dodo5522 commented 5 years ago

@wsc96 I'm new in this awesome tool mech, but I could provision VM with my below sample Mechfile. "type": "file" is just to copy a file from HOST to GEST VM. "type": "shell" is to run a script file on GEST VM.

{
  "box": "dodo5522/ubuntu-dev",
  "box_version": "1.0.1",
  "name": "mechtest",
  "url": "https://vagrantcloud.com/dodo5522/boxes/ubuntu-dev/versions/1.0.1/providers/vmware.box",
  "provision": [
    {   
      "type": "file",
      "source": "./temporary.txt",
      "destination": "/tmp/temporary.txt",
    },  
    {   
      "type": "shell",
      "path": "./apt.sh",
      "args": [], 
    },  
  ]
}