Hello, if your script work after this:
vagrant destroy vagrant up vagrant ssh sudo su - bash /vagrant/provision/<script> then is ready to be included inside vagrant. https://www.vagrantup.com/docs/provisioning/shell.html config.vm.provision "shell", path: "provision/<script>" Thanks Alvaro On Tue, Aug 23, 2016 at 10:21 AM, Mohit <[email protected]> wrote: > Hi, > > This is what I am trying to achieve. > > .provision/bootstrap.sh file--- > > #!/bin/bash > > sudo apt-get update > sudo apt-get install -y git > mkdir -p ~/.ssh > chmod 700 ~/.ssh > ssh-keyscan -H git.www.com >> ~/.ssh/known_hosts > ssh -T [email protected] > git clone http://git.www.com/proj/project1.git > git clone http://git.www.com/proj/project12.git > > cd project2 > install script.sh > cd .. > cd project1 > customcommand build ---------------- customcommand is install when I > install script.sh > > My structure is like : > Readme.md > Vagrantfile > .provision - folder > ./provision/bootstrap.sh > > I am really thankful for all the help you are providing me. > > Thanks, > > > On Monday, August 22, 2016 at 1:06:45 PM UTC+5:30, Alvaro Miranda Aguilera > wrote: >> >> Hello >> >> >> I think you want to create your own repo and add code to learn, then you >> can add external code >> >> Please clarify what you mean by clone repo, I assume you know how to use >> Git. >> Please confirm. >> >> Alvaro >> >> On Mon, Aug 22, 2016 at 8:12 AM, Mohit <[email protected]> wrote: >> >>> Hi, >>> >>> Thanks a lots, I was able to create VM box. >>> Next step for me >>> a) Clone a git repo >>> b) Install custom "install.sh" file" >>> c) Execute a particular code which basically created all logs file and >>> other stuffs. >>> >>> So how to do git clone and execute code in my provision file. ".sh file" >>> >>> Thanks, >>> Amit laspal >>> >>> On Thursday, August 18, 2016 at 1:08:25 PM UTC+5:30, Alvaro Miranda >>> Aguilera wrote: >>>> >>>> Hello, >>>> >>>> I think we can start from the basics. >>>> >>>> - Install vagrant version 1.8+ >>>> - Install virtualbox >>>> >>>> Then do this: >>>> >>>> mkdir precise64 >>>> cd precise64 >>>> vagrant init -m hashicorp/precise64 >>>> vagrant up >>>> >>>> That will create a guest VM using a box hosted in atlas. >>>> >>>> Whats a box? a VM template in a particular format that vagrant >>>> understand. >>>> >>>> The box in atlas is here: >>>> https://atlas.hashicorp.com/hashicorp/boxes/precise64 >>>> >>>> After you start this VM, you can see the guest running and the base box >>>> was added to your computer. >>>> >>>> vagrant box list >>>> >>>> From here, you have 2 paths, update the guest VM and when you are happy >>>> with the results, package it and create a new one >>>> or >>>> create a packer project and create a new VM >>>> >>>> Let me know where more clarification is needed and happy to help. >>>> >>>> >>>> If you don't have an atlas account, please create one here: >>>> https://atlas.hashicorp.com/account/new >>>> >>>> And then perform the following tutorial: >>>> https://atlas.hashicorp.com/tutorial/packer-vagrant >>>> >>>> And we can take it from there. >>>> >>>> Alvaro. >>>> >>> -- >>> This mailing list is governed under the HashiCorp Community Guidelines - >>> https://www.hashicorp.com/community-guidelines.html. Behavior in >>> violation of those guidelines may result in your removal from this mailing >>> list. >>> >>> GitHub Issues: https://github.com/mitchellh/vagrant/issues >>> IRC: #vagrant on Freenode >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "Vagrant" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit https://groups.google.com/d/ms >>> gid/vagrant-up/a7a418b3-d57e-4455-ba9d-fa1291a534c1%40googlegroups.com >>> <https://groups.google.com/d/msgid/vagrant-up/a7a418b3-d57e-4455-ba9d-fa1291a534c1%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> Alvaro >> (+31)103400555 >> > -- Alvaro (+31)103400555 -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/mitchellh/vagrant/issues IRC: #vagrant on Freenode --- You received this message because you are subscribed to the Google Groups "Vagrant" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0exX4X3Pywzr2apBZsQzatzbP9O95no1skE1MJjChHfnNQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
