Skip to content

neoxia/laravel-gae

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status

Laravel GAE

This packages provides helpers and drivers in order to deploy a Laravel application to Google App Engine. It helps building the application and connects to Google Cloud Storage.

Installation

In order to install this package, you have to add neoxia/laravel-gae in your composer.json.

"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/neoxia/laravel-gae"
    }
],
"require": {
    "neoxia/laravel-gae": "master"
},

And add the service providers in config/app.php.

Neoxia\GAE\Console\GAEConsoleServiceProvider::class,
Neoxia\GAE\Filesystem\GAEFilesystemServiceProvider::class,
Neoxia\GAE\Migrations\GAEMigrationsServiceProvider::class,

Usage

When building your application, run gae:compile-views and gae:compile-app-file. You need a app.blade.yaml file at the root of your project. The variables sent to this view come from the builder environment variables.

You can specify several targets for different builds, and some environment variables will be parsed in accordance to the specified target. For example, if you specify --target=master, the variable called MASTER__APP_DEBUG will replace the APP_DEBUG. This is useful when all your configuration is in your environment for security.

You also need call the migrations route, which will run all the migrations for your database. It will also create the database if it doesn't exist. You can call this routes by using curl :

curl --data "token=YOUR_TOKEN" https://[VERSION-dot-][SERVICE-dot-]PROJECT_ID.appspot.com/migrate

Service account key management encryption

To encrypt your google service account key, type the following command

openssl aes-256-cbc -e -a -in SERVICE_ACCOUNT_KEY.json -out SERVICE_ACCOUNT_KEY.json.enc -k RANDOM_PASSPHRASE_USED_TO_DECRYPT

To decrypt your google service account key, type the following command

openssl aes-256-cbc -d -a -in SERVICE_ACCOUNT_KEY.json.enc -out SERVICE_ACCOUNT_KEY.json -k RANDOM_PASSPHRASE_USED_TO_DECRYPT