Merge pull request #10 from jbrooksuk/heroku-button

Heroku button
This commit is contained in:
James Brooks
2014-11-20 19:35:35 +00:00
7 changed files with 48 additions and 6 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).

15
app.json Normal file
View File

@@ -0,0 +1,15 @@
{
"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",
"APP_NAME": "My Status Page"
},
"scripts": {
"postdeploy": "php artisan migrate"
}
}

View File

@@ -0,0 +1,20 @@
<?php
$dbURL = parse_url(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

@@ -17,7 +17,7 @@ class CreateIncidentsTable extends Migration {
$table->increments('id');
$table->tinyInteger('component')->default(1);
$table->string('name');
$table->tinyInteger('status', 1)->default(1);
$table->tinyInteger('status')->default(1);
$table->longText('message');
$table->timestamps();
$table->softDeletes();

View File

@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{{ Setting::get('site_name') }} | Cachet</title>
<title>{{ getenv('APP_NAME') }} | Cachet</title>
<!-- Set the viewport width to device width for mobile -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="http://james-brooks.uk">

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';
});
/*
|--------------------------------------------------------------------------