GithubHelp home page GithubHelp logo

laravel-ex's Introduction

Laravel 5.2 Quickstart on OpenShift

Laravel is a free, open source PHP web application framework, designed for the development of model–view–controller (MVC) web applications.

This quickstart was created to make it easy to get started with Laravel 5.2 on OpenShift v3.

The simplest way to install this application is to use the OpenShift quickstart template. To install the quickstart, follow these directions.

Installation

  1. Create an account at http://www.openshift.com/devpreview/register.html

  2. Install the OpenShift CLI tools

  3. Add the Laravel template(s) to your project:

    $ oc create -f https://raw.githubusercontent.com/luciddreamz/laravel-ex/master/openshift/templates/laravel-mysql.json
    

    or

    $ oc create -f https://raw.githubusercontent.com/luciddreamz/laravel-ex/master/openshift/templates/laravel-postgresql.json
    

    or

    $ oc create -f https://raw.githubusercontent.com/luciddreamz/laravel-ex/master/openshift/templates/laravel-sqlite.json
    
  4. Fork this GitHub repo

  5. From the web console, select your project, click Add to Project, and select the Laravel template under the PHP heading

  6. Replace the user name in the Git Repository URL parameter with your GitHub user name to point the template to your fork

  7. Scroll to the bottom of the page and click [ Create ] to deploy your application

  8. Follow these instructions to configure automated builds, allowing you to push your code to your GitHub repo and automatically trigger a new deployment

OpenShift Considerations

These are some special considerations you may need to keep in mind when running your application on OpenShift.

Local vs. Remote Development

This Laravel quickstart provides separate configuration files for both local and remote development. Use .env for local development, and .s2i/environment for remote development.

Remote Development

Your application is configured to automatically use an OpenShift MySQL, PostgreSQL, or SQLite database in when deployed on OpenShift using the included templates (see openshift/templates).

Additionally, your APP_ENV, APP_URL, and APP_KEY can be set by following the installation instructions with the included templates.

Laravel Migrations

The php artisan migrate --force command is automatically executed during deployment when using any of the included templates (see openshift/templates).

Composer

During the build process, composer install is automatically executed over the root directory. See the PHP 5.6 builder image for more details, or more specifically see here.

'Development' Mode

By default, this Quickstart is configured in 'development' mode to make debugging your application easier.

When you develop your Laravel application in OpenShift, you can also enable the 'production' environment by setting environment variables, using the oc client, like:

$ oc get services
NAME                     CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
laravel-mysql-example   172.30.79.234   <none>        8080/TCP   23m
$ oc set env dc/laravel-mysql-example LARAVEL_APP_ENV=production LARAVEL_APP_DEBUG=false OPCACHE_REVALIDATE_FREQ=2

Next, run oc status to confirm that an updated deployment has been kicked off.

For more information on environment variables impacting PHP behavior on OpenShift, see the PHP 5.6 builder image.

For more information on Laravel environment variables, see the Laravel environment configuration documentation.

Log Files

Your application is configured to use the OpenShift log directory. You can use the oc logs command to stream the latest log file entries from your running pod:

$ oc get pods
NAME                             READY     STATUS      RESTARTS   AGE
laravel-mysql-example-1-build   0/1       Completed   0          26m
laravel-mysql-example-1-hj2k1   1/1       Running     0          23m
$ oc logs laravel-mysql-example-1-hj2k1

To stop tailing the logs, press Ctrl + c.

Additional Resources

Documentation for the Laravel framework can be found on the Laravel website. Check out OpenShift's Documentation for help running PHP on OpenShift.

laravel-ex's People

Contributors

dinhxuanvu avatar luciddreamz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

laravel-ex's Issues

Can't build with V3..

I just followed migration guide for laravel + mysql

and also looking into bw-configuring-automated-builds
I forked with this repository and created an app in my project with my fork repository

and added woobhook, and pushed master with changing title of html and push master then got woobhook failing..

I tried it manually, oc start-build masterovlt -n mastervolt but both response on wookhook and cmd same error..

An error occurred while starting the build. Reason: Error resolving ImageStreamTag php:7.0 in namespace mastervolt: imagestreams.image.openshift.io "php" not found

I just set git repository url and chaned app namespace, DB name, DB user on app creation..

The interesting thing is that I got response 200 on first webhook but failed on second time.
Do I missed somthing? Please help me I haven't been used to this V3

How to have local git instead of github?

How do I update my project from my local pc instead of github?
I were able to do that on openshift v2 but I can't understand how the v3 image work.
Can you provide a simple guide on this?

Laravel 5.5 support

Hi I'm struggling to get laravel 5.5 to work on openshift. How can I get this project to work for 5.5?

Cronjobs

Hey, how would I run the scheduled tasks with openshift?

How do I add another artisan hook?

I haven't fully understood how ./migrate-database.sh works. I try to add another bash script and add it to post hook either mid hook in Openshift deployment config, but they don't work. The script is a custom artisan command, that make a cache. But it seems nothing cached.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.