once-as-vagrant.sh 655 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env bash
  2. #== Import script args ==
  3. github_token=$(echo "$1")
  4. #== Bash helpers ==
  5. function info {
  6. echo " "
  7. echo "--> $1"
  8. echo " "
  9. }
  10. #== Provision script ==
  11. info "Provision-script user: `whoami`"
  12. info "Configure composer"
  13. composer config --global github-oauth.github.com ${github_token}
  14. echo "Done!"
  15. info "Install project dependencies"
  16. cd /app
  17. composer --no-progress --prefer-dist install
  18. info "Create bash-alias 'app' for vagrant user"
  19. echo 'alias app="cd /app"' | tee /home/vagrant/.bash_aliases
  20. info "Enabling colorized prompt for guest console"
  21. sed -i "s/#force_color_prompt=yes/force_color_prompt=yes/" /home/vagrant/.bashrc