once-as-vagrant.sh 768 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env bash
  2. source /app/vagrant/provision/common.sh
  3. #== Import script args ==
  4. github_token=$(echo "$1")
  5. #== Provision script ==
  6. info "Provision-script user: `whoami`"
  7. info "Configure composer"
  8. composer config --global github-oauth.github.com ${github_token}
  9. echo "Done!"
  10. info "Install project dependencies"
  11. cd /app
  12. composer --no-progress --prefer-dist install
  13. info "Init project"
  14. ./init --env=Development --overwrite=y
  15. info "Apply migrations"
  16. ./yii migrate --interactive=0
  17. ./yii_test migrate --interactive=0
  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