Search code examples
puphpet

puphpet how to configura to automatically clone a repository?


I'm starting to use puphpet, I want to use it to automatically clone a repository on provision but I'm not able to find a way, is this possible?


Solution

  • One posibility that I found is create a .sh script on puphpet/files/exec-once-unprivileged/

    The content of the script could be something like:

    cd /vagrant
    # Add github.com into known hosts to avoid interactive question
    ssh -T git@github.com -o StrictHostKeyChecking=no
    git clone ssh://git@github.com/repository
    

    If you want to clone a private repository you can use ssh-agent to use the ssh keys of the host machine in the VM. To do this do on the host machine:

    ssh-add ~/.ssh/id_rsa