Skip to content

Commit

Permalink
Setup heroku deploy
Browse files Browse the repository at this point in the history
Summary:
- Remove gemfile stuff
- Add post-install-cmd to run phinx
- Add Procfile

One step closer to auto deploys

Test Plan:
- Get a heroku account and heroku cli
- `heroku create`
- `heroku addons:add cleardb`
- `heroku config` this should show you the database url
- Add heroku config vars:
DB_HOST, DB_NAME, DB_PASS, DB_TYPE, DB_USER
- `git push heroku HEAD:master`
- Wait for stuff to build

Reviewers: aMoniker

Reviewed By: aMoniker

Differential Revision: https://phabricator.ushahidi.com/D646
  • Loading branch information
rjmackay committed Jan 27, 2015
1 parent 73c7324 commit 0a9b660
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 35 deletions.
17 changes: 14 additions & 3 deletions .travis.yml
Expand Up @@ -9,8 +9,19 @@ php:
services:
- mysql
install:
- composer install --no-interaction
- composer self-update
- composer install --no-interaction --no-scripts
before_script:
- ./bin/tests install
- "./bin/tests install"
script:
- ./bin/tests run --no-install
- "./bin/tests run --no-install"
deploy:
provider: heroku
api_key:
secure: fkC2bEELMXojW0FFkWAlSayqR7GaB3bab/AwB+CW9vKyTd7qNs099mthWpV4iAaJXHQ64IYHvvfQ0IZ7VV/+JX3zsfzTKpcF70ArmQnERIW1cppV4ZtfxcRLHu70FP0Ab0Crenh/6wlj7NtmOfYVgi6L7lFQvNADqfPn2cYuXyk=
app:
master: ushahidi-platform-api-master
release: ushahidi-platform-api-release
on:
repo: ushahidi/platform
branch: heroku-deploy
5 changes: 0 additions & 5 deletions Gemfile

This file was deleted.

1 change: 1 addition & 0 deletions Procfile
@@ -0,0 +1 @@
web: bin/heroku-php-apache2 -C apache_heroku.conf httpdocs/
3 changes: 1 addition & 2 deletions Puppetfile
Expand Up @@ -4,5 +4,4 @@ mod "puppetlabs/apt"
mod "puppetlabs/mysql"
mod "puppetlabs/apache"
mod "example42/php"
mod "willdurand/nodejs"
mod "tPl0ch/composer"
mod "tPl0ch/composer"
13 changes: 13 additions & 0 deletions apache_heroku.conf
@@ -0,0 +1,13 @@
# Turn on URL rewriting
RewriteEngine On

RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^index\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]

RewriteRule .? %{ENV:BASE}/index.php [L]
15 changes: 13 additions & 2 deletions composer.json
Expand Up @@ -62,7 +62,12 @@
"wouter/acl": "dev-master",
"twilio/sdk": "3.12.*",
"vlucas/phpdotenv": "~1.0@dev",
"zeelot/kohana-media": "1.3.*@dev"
"zeelot/kohana-media": "1.3.*@dev",
"ext-curl": "*",
"ext-gd": "*",
"ext-json": "*",
"ext-mbstring": "*",
"ext-mcrypt": "*"
},
"require-dev": {
"behat/behat": "~2.5.2",
Expand All @@ -75,7 +80,8 @@
"phpunit/dbunit": "~1.2.3",
"phpspec/phpspec": "~2.1.0",
"symfony/console": "2.6.*",
"squizlabs/php_codesniffer": "1.5.*"
"squizlabs/php_codesniffer": "1.5.*",
"heroku/heroku-buildpack-php": "dev-master"
},
"minimum-stability": "dev",
"config": {
Expand All @@ -91,5 +97,10 @@
"psr-4": {
"Ushahidi\\": "src/"
}
},
"scripts": {
"post-install-cmd" : [
"bin/phinx migrate -c application/phinx.php"
]
}
}
59 changes: 55 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 1 addition & 19 deletions puppet/manifests/main.pp
Expand Up @@ -113,17 +113,6 @@
require => File["/var/www/httpdocs"],
}

# NodeJS and NPM setup
class { 'nodejs':
version => 'latest',
}

package { 'bower':
ensure => present,
provider => npm,
require => Class['nodejs']
}

# Ushahidi directories and files
file { '/var/www/application/cache':
ensure => directory,
Expand Down Expand Up @@ -164,11 +153,6 @@
ensure => "absent"
}

exec { "gem-bundler":
command => "gem install bundler",
onlyif => "test ! `which bundle`"
}

exec { "bin-update":
path => "/usr/local/node/node-default/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
environment => [
Expand All @@ -182,8 +166,6 @@
File["/var/www/application/config/environments/development/database.php"],
Package["php5-cli"],
Package["php5-mysqlnd"],
Package["bower"],
Class["composer"],
Exec["gem-bundler"]
Class["composer"]
]
}

0 comments on commit 0a9b660

Please sign in to comment.