For instructions on how to use this application with OpenShift, start by reading the Developer Guide.
The source code for this application is available to be forked from the OpenShift GitHub repository. You can configure a webhook in your repository to make OpenShift automatically start a build whenever you push your code:
After you save your webhook, if you refresh your settings page you can see the status of the ping that Github sent to OpenShift to verify it can reach the server.
Note: adding a webhook requires your OpenShift server to be reachable from GitHub.
If you forked the application from the OpenShift GitHub example, you'll need to manually clone the repository to your local system. Copy the application's source code Git URL and then run:
$ git clone <git_url> <directory_to_create> # Within your project directory # Commit your changes and push to OpenShift $ git commit -a -m 'Some commit message' $ git push
After pushing changes, you'll need to manually trigger a build if you did not setup a webhook as described above.
In order to access the original CakePHP application, you must restore the original src/Template/Layout/default.ctp.default and src/Template/Pages/home.ctp.default files.
It will also be necessary to update your application to talk to your database back-end. The
config/app.php file used by CakePHP was set up in such a way that it will accept environment variables for your connection information that you pass to it.
Once an administrator has created a MySQL database service for you to connect with you can add the following environment variables to your deploymentConfig to ensure all your frontend pods have access to these environment variables.
Note: the cakephp-mysql.json template creates the DB service and environment variables for you.
oc env dc/cakephp-mysql-example DATABASE_SERVICE_NAME=<database service name> oc env dc/cakephp-mysql-example DATABASE_ENGINE=mysql oc env dc/cakephp-mysql-example DATABASE_NAME=<your created database> oc env dc/cakephp-mysql-example <database service name>_DATABASE_USER=<your database user> oc env dc/cakephp-mysql-example <database service name>_DATABASE_PASSWORD=<your database user's password>
Note: If the database service is created in the same project as the frontend pod, the *_SERVICE_HOST and *_SERVICE_PORT environment variables will be automatically created.
You will need to redeploy your application in order to pick up the new environment variables. You can force a deployment by running:
oc deploy cakephp-mysql-example --latest
Documentation on how to manage your application from the Web Console or Command Line is available at the Developer Guide.
You can use the Web Console to view the state of your application components and launch new builds.
With the OpenShift command line interface (CLI), you can create applications and manage projects from a terminal.
Page view count: 240