Skip to content

Commit

Permalink
Merge branch 'main' into feature/health-endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Pieter committed Nov 13, 2024
2 parents 8af2c76 + ba0d0b2 commit b594ebf
Show file tree
Hide file tree
Showing 25 changed files with 2,392 additions and 2,611 deletions.
29 changes: 29 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# General
**/.DS_Store
**/*.md
**/LICENSE

# Git
**/.git
**/.github
**/.gitattributes
**/.gitignore

# Docker
**/.dockerignore
**/Dockerfile
**/docker-compose.yaml

# Laravel
bootstrap/cache
storage/framework
storage/logs
!bootstrap/cache/.gitignore
!storage/**/.gitignore
tests
vendor

# Env
.env
.env.*
!.env.example
86 changes: 43 additions & 43 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
APP_NAME=Laravel
APP_ENV=local
APP_NAME=
APP_ENV=
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
APP_DEBUG=
APP_URL=

LOG_CHANNEL=
LOG_DEPRECATIONS_CHANNEL=
LOG_LEVEL=

DB_CONNECTION=
DB_HOST=
DB_PORT=
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
BROADCAST_DRIVER=
CACHE_DRIVER=
FILESYSTEM_DISK=
QUEUE_CONNECTION=
SESSION_DRIVER=
SESSION_LIFETIME=

MEMCACHED_HOST=127.0.0.1
MEMCACHED_HOST=

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
REDIS_HOST=
REDIS_PASSWORD=
REDIS_PORT=

MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"
MAIL_MAILER=
MAIL_HOST=
MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=
MAIL_FROM_ADDRESS=
MAIL_FROM_NAME=

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_DEFAULT_REGION=
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
AWS_USE_PATH_STYLE_ENDPOINT=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1

VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
PUSHER_PORT=
PUSHER_SCHEME=
PUSHER_APP_CLUSTER=

VITE_PUSHER_APP_KEY=
VITE_PUSHER_HOST=
VITE_PUSHER_PORT=
VITE_PUSHER_SCHEME=
VITE_PUSHER_APP_CLUSTER=
58 changes: 58 additions & 0 deletions .env.testing
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
APP_NAME=Project Name
APP_ENV=test
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1

VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
10 changes: 10 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
groups:
all-actions:
patterns: ['*']
20 changes: 20 additions & 0 deletions .github/workflows/auto-deploy-to-development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Auto-deploy to development

on: # yamllint disable-line rule:truthy
push:
branches: ['main']
workflow_dispatch:

jobs:
build-and-deploy:
uses: wisemen-digital/devops-github-actions/.github/workflows/workflow-build-and-deploy-scaleway.yml@main
with:
environment: development
scaleway-container-registry: ${{ vars.CONTAINER_REGISTRY_ENDPOINT }}
scaleway-organization-id: ${{ vars.SCALEWAY_ORGANIZATION_ID }}
scaleway-project-id: ${{ vars.SCALEWAY_PROJECT_ID }}
scaleway-region: ${{ vars.SCALEWAY_REGION }}
scaleway-cluster-id: ${{ vars.K8S_CLUSTER_ID }}
cluster-deployments: ${{ vars.K8S_DEPLOYMENTS }}
secrets: inherit
28 changes: 28 additions & 0 deletions .github/workflows/promote-to-enviroment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Promote to enviroment

on: # yamllint disable-line rule:truthy
workflow_dispatch:
inputs:
environment:
description: Target environment to deploy TO
type: environment
required: true
source-tag:
description: Source tag (defaults to previous environment)
type: string
required: false

jobs:
promote-to-env:
uses: wisemen-digital/devops-github-actions/.github/workflows/workflow-promote-to-environment-scaleway.yml@main
with:
environment-source: ${{ inputs.source-tag }}
environment-target: ${{ inputs.environment }}
scaleway-container-registry: ${{ vars.CONTAINER_REGISTRY_ENDPOINT }}
scaleway-organization-id: ${{ vars.SCALEWAY_ORGANIZATION_ID }}
scaleway-project-id: ${{ vars.SCALEWAY_PROJECT_ID }}
scaleway-region: ${{ vars.SCALEWAY_REGION }}
scaleway-cluster-id: ${{ vars.K8S_CLUSTER_ID }}
cluster-deployments: ${{ vars.K8S_DEPLOYMENTS }}
secrets: inherit
15 changes: 15 additions & 0 deletions .github/workflows/pullrequest-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: PR Check

on: # yamllint disable-line rule:truthy
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main

jobs:
lint-build-test:
uses: wisemen-digital/devops-github-actions/.github/workflows/laravel-build-and-test.yml@main
if: github.event.pull_request.draft == false
with:
php-version: '8.3'
66 changes: 50 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,56 @@
/.phpunit.cache
# Compiled output
/dist
/node_modules
/vendor
/.phpunit.cache
/public/build

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Tests
/test-reports
.phpunit.result.cache

# OS
.DS_Store

# IDEs and editors
/.idea
/.fleet
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
.editorconfig

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# Environment files
.env
.env.*
!.env.example
!.env.testing

# Keys
auth.json
/storage/*.key

# Storage
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.env.production
.phpunit.result.cache
Homestead.json
Homestead.yaml
auth.json
npm-debug.log
yarn-error.log
/.fleet
/.idea
/.vscode
/test-reports
.editorconfig
.DS_Store
2 changes: 1 addition & 1 deletion .php-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.2
8.3
38 changes: 38 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Command line arguments, such as PHP version
ARG PHP_VERSION=8.3

#
# --- Stage 1: Build ---
#

FROM lorisleiva/laravel-docker:${PHP_VERSION} as build

ARG BUILD_COMMIT
ARG BUILD_NUMBER
ARG BUILD_TIMESTAMP

# Install dependencies
WORKDIR /app
COPY composer.json composer.lock ./
RUN composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts

# Copy files
COPY . .

# Optimize a bit
RUN composer dump-autoload --optimize --classmap-authoritative \
&& php artisan event:cache \
&& php artisan route:cache \
&& php artisan view:cache

#
# --- Stage 2: Run ---
#

FROM ghcr.io/wisemen-digital/php-base:${PHP_VERSION} as final

# Add application
COPY --from=build --chown=nobody /app/ /app/www/

# Symlinks (must be created on final system)
RUN php artisan storage:link
2 changes: 2 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\ServiceProvider;
use Laravel\Passport\Passport;

class AppServiceProvider extends ServiceProvider
{
Expand All @@ -20,6 +21,7 @@ public function register(): void
*/
public function boot(): void
{
Passport::enablePasswordGrant();

Model::preventLazyLoading(! app()->isProduction());
}
Expand Down
Loading

0 comments on commit b594ebf

Please sign in to comment.