Skip to content

Commit

Permalink
Merge branch 'laravel-buildpack' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jamalc committed Dec 18, 2024
2 parents 0c7dc0c + 6baba28 commit 4944b92
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!include:.gitignore
.git
!/public/build/manifest.json
3 changes: 3 additions & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
web: pid1 --nginxBinaryPath nginx --nginxConfigPath /layers/google.php.webconfig/webconfig/nginx.conf --serverConfigPath /layers/google.php.webconfig/webconfig/nginxserver.conf --nginxErrLogFilePath /var/log/nginx.log --customAppCmd "php-fpm -R --nodaemonize --fpm-config /layers/google.php.webconfig/webconfig/php-fpm.conf" --pid1LogFilePath /var/log/pid1.log --mimeTypesPath /layers/google.utils.nginx/nginx/conf/mime.types --customAppSocket /layers/google.php.webconfig/webconfig/app.sock
migrate: php artisan migrate
static: npm run update-static
10 changes: 10 additions & 0 deletions bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@
App\Exceptions\Handler::class
);

// [START cloudrun_laravel_secret_manager_mount]
/* Load settings from a mounted volume, if available. */
$settings_dir = $_ENV['APP_SETTINGS_DIR'] ?? '/config';

if (file_exists($settings_dir . '/.env')) {
$dotenv = Dotenv\Dotenv::createImmutable($settings_dir);
$dotenv->load();
}
// [END cloudrun_laravel_secret_manager_mount]

/*
|--------------------------------------------------------------------------
| Return The Application
Expand Down
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@
"license": "MIT",
"require": {
"php": "^8.1",
"guzzlehttp/guzzle": "^7.2",
"google/auth": "^1.45",
"google/cloud-core": "^1.60",
"guzzlehttp/guzzle": "^7.9",
"inertiajs/inertia-laravel": "^0.6.8",
"laravel/framework": "^10.10",
"laravel/jetstream": "^4.1",
"laravel/sanctum": "^3.3",
"laravel/socialite": "^5.16",
"laravel/tinker": "^2.8",
"laravel/ui": "^4.2",
"livewire/livewire": "^3.5",
"socialiteproviders/manager": "^4.6",
"socialiteproviders/microsoft-azure": "^5.2",
"tightenco/ziggy": "^1.0"
"tightenco/ziggy": "^2.4",
"vlucas/phpdotenv": "^5.6"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
Expand Down
2 changes: 1 addition & 1 deletion config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@

'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'),
],

'default' => [
Expand Down
2 changes: 1 addition & 1 deletion config/filesystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'url' => env('APP_URL') . '/storage',
'visibility' => 'public',
'throw' => false,
],
Expand Down
9 changes: 9 additions & 0 deletions cors-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"origin": ["https://laravel-961954531666.us-central1.run.app"],
"method": ["GET", "HEAD", "OPTIONS"],
"responseHeader": ["Content-Type"],
"maxAgeSeconds": 3600
}
]

4 changes: 4 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php

// Ensure the default Laravel index is found.
require 'public/index.php';
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build"
"build": "vite build",
"update-static": "vite build && gsutil -o \"GSUtil:parallel_process_count=1\" -m cp -r public/* gs://${ASSET_BUCKET}"
},
"devDependencies": {
"@popperjs/core": "^2.11.6",
Expand Down
15 changes: 7 additions & 8 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Unit">
<directory>tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory>tests/Feature</directory>
</testsuite>
</testsuites>
<source>
<coverage processUncoveredFiles="true">
<include>
<directory>app</directory>
<directory suffix=".php">./app</directory>
</include>
</source>
</coverage>

<php>
<env name="APP_ENV" value="testing"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="DB_DATABASE" value="testing"/>
<!-- <env name="DB_CONNECTION" value="sqlite"/> -->
<!-- <env name="DB_DATABASE" value=":memory:"/> -->
<env name="MAIL_MAILER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
Expand Down

0 comments on commit 4944b92

Please sign in to comment.