diff --git a/.env.example b/.env.example index 212ccd80..40dc5744 100644 --- a/.env.example +++ b/.env.example @@ -3,10 +3,10 @@ APP_DEBUG=true APP_URL=http://localhost APP_KEY=SomeRandomString -DB_DRIVER=sqlite +DB_DRIVER=mysql DB_HOST=localhost DB_DATABASE=cachet -DB_USERNAME=user +DB_USERNAME=homestead DB_PASSWORD=secret CACHE_DRIVER=file diff --git a/.gitignore b/.gitignore index 51669198..b53d52e5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules phpunit.xml vendor +.vagrant diff --git a/Homestead.yaml b/Homestead.yaml new file mode 100644 index 00000000..9c2d4333 --- /dev/null +++ b/Homestead.yaml @@ -0,0 +1,40 @@ +--- +ip: "192.168.10.10" +memory: 2048 +cpus: 1 +hostname: cachet +name: cachet +provider: virtualbox + +authorize: ~/.ssh/id_rsa.pub + +keys: + - ~/.ssh/id_rsa + +folders: + - map: "/srv/www/Cachet" + to: "/home/vagrant/Cachet" + +sites: + - map: homestead.app + to: "/home/vagrant/Cachet/public" + +databases: + - cachet + +variables: + - key: APP_ENV + value: local + +# blackfire: +# - id: foo +# token: bar +# client-id: foo +# client-token: bar + +# ports: +# - send: 93000 +# to: 9300 +# - send: 7777 +# to: 777 +# protocol: udp diff --git a/README.md b/README.md index 47bcf356..3a8a1547 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,39 @@ Here is a list of things that Cachet is not or does not do: 2. It does not work on a plugin system. There are no monitoring services to extend. 3. It's not a Twitter clone. +## Quickstart with Vagrant + +If you would like to utilize [laravel homestead](http://laravel.com/docs/5.1/homestead), we have a per-project installation available to use for development purposes. + +First, modify Homestead.yaml to map your Cachet directory to the Vagrant VM properly. It looks like this by default: + +```yaml +folders: + - map: "/srv/www/Cachet" + to: "/home/vagrant/Cachet" +``` + +Change the map key to the location of your Cachet installation and follow the instructions below. + +```bash +# Copy over your environment variables +$ cp .env.example .env + +# Initiate VM +$ vagrant up + +# Generate application key +$ php artisan key:generate + +# SSH into your machine +$ vagrant ssh + +# Run migrations +$ cd Cachet && php artisan migrate +``` + +Navigate to http://192.168.10.10 and begin using Cachet! + ## Quickstart with Docker Run a DB container (you can either pass in environment variables for the DB, or mount a config with `-v /my/database.php:/var/www/html/app/config/database.php`): diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 00000000..ae03f592 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,23 @@ +require 'json' +require 'yaml' + +VAGRANTFILE_API_VERSION = "2" +confDir = $confDir ||= File.expand_path("vendor/laravel/homestead") + +homesteadYamlPath = "Homestead.yaml" +afterScriptPath = "after.sh" +aliasesPath = "aliases" + +require File.expand_path(confDir + '/scripts/homestead.rb') + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + if File.exists? aliasesPath then + config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases" + end + + Homestead.configure(config, YAML::load(File.read(homesteadYamlPath))) + + if File.exists? afterScriptPath then + config.vm.provision "shell", path: afterScriptPath + end +end diff --git a/composer.json b/composer.json index d2ddd3d7..1b561acf 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,8 @@ "require-dev": { "fzaninotto/faker": "^1.5", "graham-campbell/testbench-core": "^1.0", - "phpunit/phpunit": "^4.7.6" + "phpunit/phpunit": "^4.7.6", + "laravel/homestead": "dev-master" }, "autoload": { "classmap": [ diff --git a/composer.lock b/composer.lock index e522307a..f6e176f4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "687f3b651fc7e102f31fd6cc34bd2020", + "hash": "52170701af5a0e6e40fbc59832487b3e", "packages": [ { "name": "alt-three/segment", @@ -3436,6 +3436,47 @@ "time": "2015-06-26 16:35:19" }, { + "name": "laravel/homestead", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/laravel/homestead.git", + "reference": "835d8f223a95fd763f6fc7c4ee119692893af3a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/homestead/zipball/835d8f223a95fd763f6fc7c4ee119692893af3a1", + "reference": "835d8f223a95fd763f6fc7c4ee119692893af3a1", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "symfony/console": "~2.0", + "symfony/process": "~2.0" + }, + "bin": [ + "homestead" + ], + "type": "library", + "autoload": { + "psr-4": { + "Laravel\\Homestead\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylorotwell@gmail.com" + } + ], + "description": "A virtual machine for web artisans.", + "time": "2015-06-29 21:00:49" + }, + { "name": "phpdocumentor/reflection-docblock", "version": "2.0.4", "source": { @@ -4334,7 +4375,9 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": { + "laravel/homestead": 20 + }, "prefer-stable": true, "prefer-lowest": false, "platform": {