diff --git a/.travis.yml b/.travis.yml index c940cb8b3..cba36e8c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 799d93eac..000000000 --- a/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -# A sample Gemfile -source "https://rubygems.org" - -gem "librarian-puppet" -gem "puppet" diff --git a/Procfile b/Procfile new file mode 100644 index 000000000..c395ac039 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: bin/heroku-php-apache2 -C apache_heroku.conf httpdocs/ diff --git a/Puppetfile b/Puppetfile index 7ff86094a..0535976be 100644 --- a/Puppetfile +++ b/Puppetfile @@ -4,5 +4,4 @@ mod "puppetlabs/apt" mod "puppetlabs/mysql" mod "puppetlabs/apache" mod "example42/php" -mod "willdurand/nodejs" -mod "tPl0ch/composer" \ No newline at end of file +mod "tPl0ch/composer" diff --git a/apache_heroku.conf b/apache_heroku.conf new file mode 100644 index 000000000..5872a47ac --- /dev/null +++ b/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] diff --git a/composer.json b/composer.json index e0c8a6ade..560259eca 100644 --- a/composer.json +++ b/composer.json @@ -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", @@ -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": { @@ -91,5 +97,10 @@ "psr-4": { "Ushahidi\\": "src/" } + }, + "scripts": { + "post-install-cmd" : [ + "bin/phinx migrate -c application/phinx.php" + ] } } diff --git a/composer.lock b/composer.lock index 5c188152d..729ee35f6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "a83601074120a6f76ec0d6946ac646d9", + "hash": "6e518750fe7fdc7912587a41a8e30e5e", "packages": [ { "name": "aura/di", @@ -1896,6 +1896,50 @@ ], "time": "2014-12-18 23:26:35" }, + { + "name": "heroku/heroku-buildpack-php", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/heroku/heroku-buildpack-php.git", + "reference": "166ad317a307082d037a6d201ddb602f3295af9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/heroku/heroku-buildpack-php/zipball/166ad317a307082d037a6d201ddb602f3295af9a", + "reference": "166ad317a307082d037a6d201ddb602f3295af9a", + "shasum": "" + }, + "bin": [ + "bin/heroku-hhvm-apache2", + "bin/heroku-hhvm-nginx", + "bin/heroku-php-apache2", + "bin/heroku-php-nginx" + ], + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "David Zuelke", + "email": "dz@heroku.com" + } + ], + "description": "Toolkit for starting a PHP application locally, with or without foreman, using the same config for PHP/HHVM and Apache2/Nginx as on Heroku", + "homepage": "http://github.com/heroku/heroku-buildpack-php", + "keywords": [ + "apache", + "apache2", + "foreman", + "heroku", + "hhvm", + "nginx", + "php" + ], + "time": "2015-01-19 23:21:04" + }, { "name": "kohana/unittest", "version": "dev-3.3/develop", @@ -3356,12 +3400,19 @@ "wouter/a1": 20, "wouter/a2": 20, "wouter/acl": 20, - "zeelot/kohana-media": 20, "vlucas/phpdotenv": 20, - "kohana/unittest": 20 + "zeelot/kohana-media": 20, + "kohana/unittest": 20, + "heroku/heroku-buildpack-php": 20 }, "prefer-stable": false, "prefer-lowest": false, - "platform": [], + "platform": { + "ext-curl": "*", + "ext-gd": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-mcrypt": "*" + }, "platform-dev": [] } diff --git a/puppet/manifests/main.pp b/puppet/manifests/main.pp index d362153bd..330e0a67b 100644 --- a/puppet/manifests/main.pp +++ b/puppet/manifests/main.pp @@ -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, @@ -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 => [ @@ -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"] ] }