Created
April 23, 2014 07:43
-
-
Save yamacraft/11205881 to your computer and use it in GitHub Desktop.
BEAR.sundayメモ#1 - vagrant(DigitalOcean)+Ubuntu13.10+PHP5.5.3でBEAR.sundayのインストール ref: http://qiita.com/yamacraft/items/c6eca1e602754a55f8c6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
agrant.configure('2') do |config| | |
config.vm.hostname = 'root' | |
config.vm.provider :digital_ocean do |provider, override| | |
override.ssh.private_key_path = '~/.ssh/id_rsa' | |
provider.ssh_key_name = 'xxx' | |
override.vm.box = 'digital_ocean' | |
override.vm.box_url = "https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box" | |
provider.client_id = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |
provider.api_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |
provider.image = 'Ubuntu 13.10 x64' | |
provider.region = 'Singapore 1' | |
provider.size = '512MB' | |
provider.ca_path = '/usr/local/opt/curl-ca-bundle/share/ca-bundle.crt' | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vagrant upしたときに、グローバルIPが返ってくるのでメモしておく | |
# [default] Assigned IP address: xxx.xxx.xxx.xxx <- これ | |
# 必要なパッケージのインストール | |
apt-get update | |
apt-get install -y git php5 php5-json php5-cli php5-curl | |
# composerのインストール(/vagrant/以下に配置) | |
curl -sS https://getcomposer.org/installer | php -- --install-dir=/vagrant | |
# BEAR.sundayのインストール(プロジェクトの作成) | |
# たまに一部のパッケージをgithubから引っ張る際に、githubのid/pwを求められることがある | |
cd /vagrant/ | |
php /vagrant/composer.phar create-project bear/package bear --dev | |
# (2014/05/13追記)上のコマンドですが、実際は下のコマンドの方がオススメです。こちらは随時最新のバージョンでプロジェクトが作られます | |
php /vagrant/composer.phar create-project bear/package bear dev-develop | |
# ここまでいけば作成完了 | |
# Required | |
# [OK] PHP: 5.5.3-1ubuntu2.3 | |
# [OK] Vendor install | |
# # Optional | |
# [NG] APC: | |
# # Develop | |
# [NG] Xdebug: | |
# [NG] PDO-Sqlite: | |
# [NG] xhprof: | |
# | |
# BEAR.Sunday env check: [OK] | |
# ためしにDemo.SandBoxを起動 | |
cd /vagrant/bear | |
bin/bear.server apps/Demo.Sandbox/ | |
# さきほどメモしたIPの:8080にアクセスするとSandBoxが見える | |
# http://xxx.xxx.xxx.xxx:8080 | |
# ちなみにbin/bear.server自体は[php -S 0.0.0.0:8080]を実行しているだけ | |
# アプリケーションの新規作成 | |
cd /vagrant/bear/apps | |
php /vagrant/composer.phar create-project bear/skeleton My.Work | |
# 最後に聞かれる質問は、git cloneされたモジュール等の「元の.gitや.svnを消しますか?」という質問なので、お好きに | |
# 作成が完了すると、apps/内にMy.Work/が出来上がる | |
# 作成したアプリケーションを動かしてみる | |
cd /vagrant/bear/ | |
bin/bear.server My.Work/ | |
# さきほどのSandBoxとは違うアプリケーションが立ち上がっているのが見える |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# apps/My.Work以下で | |
../../vendor/bin/phpunit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment