Created
August 7, 2020 02:35
-
-
Save chimit/1a0205d0f4666040534ff8bf5d797f2c to your computer and use it in GitHub Desktop.
Bitbucket Pipelines config for Laravel 7 with PHP 7.4, GD and EXIF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a sample build configuration for PHP. | |
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples. | |
# Only use spaces to indent your .yml configuration. | |
# ----- | |
# You can specify a custom docker image from Docker Hub as your build environment. | |
image: php:7.4-fpm | |
definitions: | |
services: | |
mysql: | |
image: mysql:5.7 | |
environment: | |
MYSQL_DATABASE: 'testdb' | |
MYSQL_ROOT_PASSWORD: 'secret' | |
SERVICE_NAME: 'mysql' | |
steps: | |
- step: &test | |
name: Test | |
caches: | |
- composer | |
script: | |
# Install dependencies | |
- apt-get update && apt-get install -y unzip libfreetype6-dev libjpeg62-turbo-dev libpng-dev zlib1g-dev | |
# Configure and install extensions | |
- docker-php-ext-configure gd --with-freetype --with-jpeg | |
- docker-php-ext-install -j$(nproc) pdo_mysql gd exif | |
# Download and install Composer | |
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | |
- composer install | |
- ln -f -s .env.pipelines .env | |
- php artisan test | |
services: | |
- mysql | |
pipelines: | |
branches: | |
develop: | |
- step: *test | |
- step: | |
name: Deploy to staging using Laravel Forge | |
deployment: staging | |
script: | |
# Deployment webbhook | |
- curl -X POST https://forge.laravel.com/*** | |
master: | |
- step: *test | |
- step: | |
name: Deploy to production using Laravel Forge | |
deployment: production | |
script: | |
# Deployment webbhook | |
- curl -X POST https://forge.laravel.com/*** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment