Skip to content

Commit

Permalink
Update sample app to work in CI
Browse files Browse the repository at this point in the history
[#128896127]

Signed-off-by: James Wen <jrw2175@columbia.edu>
  • Loading branch information
sesmith177 authored and RochesterinNYC committed Sep 14, 2016
1 parent 4fda36e commit e30a9be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
12 changes: 5 additions & 7 deletions README.md
@@ -1,6 +1,6 @@
## CloudFoundry PHP Example Application: PHPPgAdmin

This is an example application which can be run on CloudFoundry using the [PHP Build Pack].
This is an example application which can be run on CloudFoundry using the [PHP Buildpack].

This is an out-of-the-box implementation of PHPPgAdmin. It's an example how common PHP applications can easily be run on CloudFoundry.

Expand All @@ -9,18 +9,16 @@ This is an out-of-the-box implementation of PHPPgAdmin. It's an example how com
1. Clone the app (i.e. this repo).

```bash
git clone https://github.com/dmikusa-pivotal/cf-ex-phppgadmin
git clone https://github.com/cloudfoundry-samples/cf-ex-phppgadmin
cd cf-ex-phppgadmin
```

1. If you don't have one already, create a Postgres service. With Pivotal Web Services, the following command will create a free Postgres database through [ElephantSQL].

```bash
cf create-service elephantsql turtle my-test-pgsql-db
cf create-service elephantsql turtle pgsql
```

1. Edit the manifest.yml file. Change the 'host' attribute to something unique. Then under "services:" change "pgsql-db" to the name of your Postgres service. This is the name of the service that will be bound to your application and thus available to PHPPgAdmin. Adding multiple services is OK, they will all show up in the UI.

1. Push it to CloudFoundry.

```bash
Expand All @@ -46,7 +44,7 @@ When you push the application here's what happens.

These changes were made to prepare it to run on CloudFoundry:

1. Configure the database in `config.inc.php`. This was done by reading the environment variable VCAP_SERVICES, which is populated by CloudFoundry and contains the connection information for our services, and configuring the host, port from it. See this [link](https://github.com/dmikusa-pivotal/cf-ex-phppgadmin/blob/master/htdocs/conf/config.inc.php#L13) for the details.
1. Configure the database in `config.inc.php`. This was done by reading the environment variable VCAP_SERVICES, which is populated by CloudFoundry and contains the connection information for our services, and configuring the host, port from it. See this [link](https://github.com/cloudfoundry-samples/cf-ex-phppgadmin/blob/master/htdocs/conf/config.inc.php#L13) for the details.

[PHP Build Pack]:https://github.com/cloudfoundry/php-buildpack
[PHP Buildpack]:https://github.com/cloudfoundry/php-buildpack
[ElephantSQL]:http://www.elephantsql.com/
8 changes: 3 additions & 5 deletions manifest.yml
@@ -1,10 +1,8 @@
---
applications:
- name: phppgadmin
host: myphppgadmin
memory: 128M
- name: cf-ex-phppgadmin
memory: 128M
instances: 1
domain: cfapps.io
path: .
services:
- pgsql-db
- pgsql

0 comments on commit e30a9be

Please sign in to comment.