You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

45 lines
1.1 KiB

  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 plugins for composer"
  16. composer global require "fxp/composer-asset-plugin:^1.2.0" --no-progress
  17. info "Install codeception"
  18. composer global require "codeception/codeception=2.0.*" "codeception/specify=*" "codeception/verify=*" --no-progress
  19. echo 'export PATH=/home/vagrant/.config/composer/vendor/bin:$PATH' | tee -a /home/vagrant/.profile
  20. info "Install project dependencies"
  21. cd /app
  22. composer --no-progress --prefer-dist install
  23. info "Init project"
  24. ./init --env=Development --overwrite=y
  25. info "Apply migrations"
  26. ./yii migrate <<< "yes"
  27. info "Create bash-alias 'app' for vagrant user"
  28. echo 'alias app="cd /app"' | tee /home/vagrant/.bash_aliases
  29. info "Enabling colorized prompt for guest console"
  30. sed -i "s/#force_color_prompt=yes/force_color_prompt=yes/" /home/vagrant/.bashrc