Skip to content
This repository has been archived by the owner on May 30, 2019. It is now read-only.

Commit

Permalink
added Heroku configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
EmanueleMinotto committed Nov 8, 2015
1 parent 95a28b5 commit 61e5c14
Show file tree
Hide file tree
Showing 7 changed files with 210 additions and 1 deletion.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: bin/heroku-php-apache2 web/
67 changes: 67 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"addons": [
"cleardb:ignite",
"sendgrid:starter"
],
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-nodejs"
},
{
"url": "https://github.com/elcodi/heroku-buildpack-php"
}
],
"description": "A one-click Bamboo deployment system for Heroku",
"env": {
"SYMFONY__BAMBOO_SOCIAL_GITHUB_CLIENT_ID": {
"description": "GitHub client ID.",
"value": "github-client-id"
},
"SYMFONY__BAMBOO_SOCIAL_GITHUB_CLIENT_SECRET": {
"description": "GitHub client secret.",
"value": "github-client-secret"
},
"SYMFONY__BAMBOO_SOCIAL_PAYPAL_CLIENT_ID": {
"description": "PayPal client ID.",
"value": "paypal-client-id"
},
"SYMFONY__BAMBOO_SOCIAL_PAYPAL_CLIENT_IS_SANDBOX": {
"description": "Keep the PayPal transactions in the sandbox (recommended if you're still trying the store).",
"value": "true"
},
"SYMFONY__BAMBOO_SOCIAL_PAYPAL_CLIENT_SECRET": {
"description": "PayPal client secret.",
"value": "paypal-client-secret"
},
"SYMFONY__LOCALE": {
"description": "The ISO 639-1 language code of your store and optional an underscore (_) and then the ISO 3166-1 alpha-2 country code (e.g. fr_FR for French/France).",
"value": "en"
},
"SYMFONY__PAYPAL_WEB_CHECKOUT_RECIPIENT": {
"description": "PayPal checkout recipient.",
"value": "payment-test-facilitator@elcodi.com"
},
"SYMFONY__SECRET": {
"description": "This is a string that should be unique to your application and it's commonly used to add more entropy to security related operations.",
"generator": "secret"
},
"SYMFONY_ENV": {
"description": "Symfony 2 environment mode.",
"value": "prod"
},
"COMPOSER_GITHUB_OAUTH_TOKEN": {
"description": "GitHub's API is subject to rate limits for anonymous requests. If the limit is hit, Composer will fall back to source-based installs instead of distribution tarballs, which will slow down builds. Using a personal OAuth token raises the limit significantly.",
"required": false
}
},
"image": "heroku/php",
"keywords": [
"ecommerce",
"elcodi",
"php",
"symfony"
],
"logo": "http://elcodi.io/img/icon/apple-icon-180x180.png",
"name": "Bamboo E-commerce",
"website": "http://elcodi.io/"
}
76 changes: 76 additions & 0 deletions app/DoctrineMigrations/Version20151028204201.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/config/common/filesystem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ knp_gaufrette:
adapters:
local:
local:
directory: /tmp/local
directory: '%kernel.root_dir%/../web/local'
create: true
filesystems:
local:
Expand Down
1 change: 1 addition & 0 deletions app/config/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
imports:
- { resource: parameters.yml }
- { resource: heroku.php, ignore_errors: true }
- { resource: security/security.yml }

# Common Elcodi configuration
Expand Down
58 changes: 58 additions & 0 deletions app/config/heroku.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

/*
* This file is part of the Elcodi package.
*
* Copyright (c) 2014-2015 Elcodi.com
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Feel free to edit as you please, and have fun.
*
* @author Marc Morera <yuhu@mmoreram.com>
* @author Aldo Chiecchia <zimage@tiscali.it>
* @author Elcodi Team <tech@elcodi.com>
*/

// if the app isn't on Heroku, don't do anything
if (!($stack = getenv('STACK')) || !($stack == 'cedar' || $stack == 'cedar-14')) {
return;
}

// SendGrid configuration
$sendgridUsername = getenv('SENDGRID_USERNAME');
$sendgridPassword = getenv('SENDGRID_PASSWORD');

if ($sendgridUsername && $sendgridPassword) {
$container->setParameter('mailer_host', 'smtp.sendgrid.com');
$container->setParameter('mailer_password', $sendgridPassword);
$container->setParameter('mailer_port', 25);
$container->setParameter('mailer_transport', 'smtp');
$container->setParameter('mailer_user', $sendgridUsername);
}

// ClearDB configuration
$cleardbDatabaseURL = getenv('CLEARDB_DATABASE_URL');

if ($cleardbDatabaseURL && filter_var($cleardbDatabaseURL, FILTER_VALIDATE_URL)) {
$cleardbDatabase = parse_url($cleardbDatabaseURL);

$container->setParameter('database_driver', 'pdo_mysql');
$container->setParameter('database_host', $cleardbDatabase['host']);
$container->setParameter('database_name', ltrim($cleardbDatabase['path'], '/'));
$container->setParameter('database_password', $cleardbDatabase['pass']);
$container->setParameter('database_port', 3306);
$container->setParameter('database_user', $cleardbDatabase['user']);
}

// http://symfony.com/doc/current/cookbook/deployment/heroku.html#preparing-your-application
$container->loadFromExtension('monolog', [
'handlers' => [
'heroku_logs' => [
'level' => 'debug',
'path' => 'php://stderr',
'type' => 'stream',
],
],
]);
6 changes: 6 additions & 0 deletions heroku.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"require": {
"ext-gd": "*",
"ext-imagick": "*"
}
}

0 comments on commit 61e5c14

Please sign in to comment.