Having a quick go with Heroku buttons!

This commit is contained in:
James Brooks
2014-11-20 19:29:06 +00:00
parent f48e390adb
commit 957f81f730
5 changed files with 45 additions and 4 deletions

1
Procfile Normal file
View File

@@ -0,0 +1 @@
web: vendor/bin/heroku-php-apache2 public

View File

@@ -1,5 +1,7 @@
# Cachet
[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)
Cachet is an open source PHP status page system using the Laravel framework.
For more information on why I started developing Cachet, check out my [blog post](http://james-brooks.uk/cachet/?utm_source=github&utm_medium=readme&utm_campaign=github-cachet).

14
app.json Normal file
View File

@@ -0,0 +1,14 @@
{
"name": "Cachet",
"description": "Single-site Status Page with Laravel",
"website": "http://james-brooks.uk/cachet",
"repository": "https://github.com/jbrooksuk/Cachet",
"keywords": ["cachet", "laravel", "status", "page"],
"addons": ["cleardb"],
"env": {
"ENV": "heroku"
},
"scripts": {
"postdeploy": "php artisan migrate"
}
}

View File

@@ -0,0 +1,20 @@
<?php
$dbURL = parseurl(getenv('CLEARDB_DATABASE_URL'));
$dbName = substr($dbURL["path"], 1);
return array(
'default' => 'cleardb',
'connections' => array(
'cleardb' => array(
'driver' => 'mysql',
'host' => $dbURL['host'],
'database' => $dbName,
'username' => $dbURL['user'],
'password' => $dbURL['pass'],
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
)
);

View File

@@ -24,11 +24,15 @@ $app = new Illuminate\Foundation\Application;
|
*/
$env = $app->detectEnvironment(array(
$env = $app->detectEnvironment(function() {
// Take care of Heroku deployment for us.
if ($envName = getenv('ENV')) {
return $envName;
}
'local' => array('homestead', '*.local', '*.config', 'jbrooksuk'),
));
// Always fall back to local.
return 'local';
});
/*
|--------------------------------------------------------------------------