Skip to content

Commit

Permalink
updates to deploy to heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyjandrews committed Apr 4, 2017
1 parent 1b80d6a commit efeedc4
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
Homestead.json
Homestead.yaml
.env
codeship.aes
deployment.env
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: vendor/bin/heroku-php-nginx -C nginx.heroku.conf /public
2 changes: 1 addition & 1 deletion app/Todo.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function getUrlAttribute()
$url = $url.':'.$url_arr['port'];
}

return $url.'/'.$this->attributes['id'];
return $url.'/todos/'.$this->attributes['id'];
}

}
4 changes: 4 additions & 0 deletions codeship-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
tag: master
service: deploy
command: codeship_heroku deploy /deploy php-laravel-todoapp
- name: migrate
tag: master
service: deploy
command: heroku run --app php-laravel-todoapp -- php artisan migrate
2 changes: 1 addition & 1 deletion config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$url = parse_url(getenv("DATABASE_URL"));
$host = $url["host"];
$username = $url["user"];
$password = isset($url["pass"]) ?: '';
$password = isset($url["pass"]) ? $url["pass"] : '';
$database = substr($url["path"], 1);

return [
Expand Down
1 change: 1 addition & 0 deletions deployment.env.encrypted
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dDwXrmLJLl6kAHIdB5i/LDPa58oMHH4qjm+iZxOQDG0/rUjDiXjGj4mm7rQy+oYed4QrL9ocVY5i4a9EMjdCHn0iOFI=
14 changes: 14 additions & 0 deletions nginx.heroku.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
location / {
# try to serve file directly, fallback to rewrite
try_files $uri @rewriteapp;
}

location @rewriteapp {
# rewrite all to app.php
rewrite ^(.*)$ /index.php/$1 last;
}

location ~ ^/(app|app_dev|config)\.php(/|$) {
try_files @heroku-fcgi @heroku-fcgi;
internal;
}

0 comments on commit efeedc4

Please sign in to comment.