Files
laravel-backend/.drone.yml
Joris Slagter 13cf05c669
Some checks failed
continuous-integration/drone/push Build is failing
Fix: Install required PHP extensions (exif, zip) for Laravel 7.x
The php:7.4-cli image is missing ext-exif and ext-zip which are required by:
- spatie/image (requires ext-exif)
- spatie/laravel-backup (requires ext-zip)
- spatie/laravel-medialibrary (depends on spatie/image)

Installing libzip-dev and using docker-php-ext-install to add these extensions.
2025-12-02 20:07:46 +01:00

104 lines
2.6 KiB
YAML

kind: pipeline
type: docker
name: default
steps:
# Step 1: Install dependencies and run tests
- name: test
image: php:7.4-cli
commands:
- apt-get update && apt-get install -y libzip-dev
- docker-php-ext-install exif zip
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version=2.2.24
- composer install --prefer-dist --no-progress --no-interaction
- composer validate --strict
- echo "✓ Composer validation passed"
# Uncomment when tests are ready:
# - php artisan test
# Step 2: Deploy to staging (on develop/main branch)
- name: deploy-staging
image: appleboy/drone-ssh
when:
branch:
- develop
- main
event:
- push
settings:
host:
from_secret: staging_host
user: root
key:
from_secret: ssh_private_key
port: 22
envs:
- GITEA_TOKEN
script:
- export GITEA_TOKEN=$GITEA_TOKEN
- /opt/deploy-scripts/deploy-laravel.sh staging main
- cd /var/www/laravel/current && php artisan migrate --force
environment:
GITEA_TOKEN:
from_secret: gitea_token
# Step 3: Deploy to production (manual trigger only)
- name: deploy-production
image: appleboy/drone-ssh
when:
branch:
- main
event:
- promote
target:
- production
settings:
host:
from_secret: production_host
user: root
key:
from_secret: ssh_private_key
port: 22
envs:
- GITEA_TOKEN
script:
- export GITEA_TOKEN=$GITEA_TOKEN
- /opt/deploy-scripts/deploy-laravel.sh production main
- cd /var/www/laravel/current && php artisan migrate --force
- cd /var/www/laravel/current && php artisan queue:restart
environment:
GITEA_TOKEN:
from_secret: gitea_token
# Step 4: Notification
- name: notify
image: plugins/slack
when:
status:
- success
- failure
settings:
webhook:
from_secret: slack_webhook
channel: deployments
username: Drone CI
template: >
{{#success build.status}}
✓ Laravel API build {{build.number}} succeeded.
Branch: {{build.branch}}
Commit: {{build.commit}}
{{else}}
✗ Laravel API build {{build.number}} failed.
Branch: {{build.branch}}
Commit: {{build.commit}}
{{/success}}
failure: ignore
trigger:
branch:
- main
- develop
event:
- push
- promote