once-as-vagrant.sh 805 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 "Init project"
  19. ./init --env=Development --overwrite=y
  20. info "Apply migrations"
  21. ./yii migrate --interactive=0
  22. ./yii_test migrate --interactive=0
  23. info "Create bash-alias 'app' for vagrant user"
  24. echo 'alias app="cd /app"' | tee /home/vagrant/.bash_aliases
  25. info "Enabling colorized prompt for guest console"
  26. sed -i "s/#force_color_prompt=yes/force_color_prompt=yes/" /home/vagrant/.bashrc