Skip to content

Instantly share code, notes, and snippets.

@butschster
Created August 3, 2018 20:05
Show Gist options
  • Save butschster/a94d49e5478aaf634badf6b49bc32b17 to your computer and use it in GitHub Desktop.
Save butschster/a94d49e5478aaf634badf6b49bc32b17 to your computer and use it in GitHub Desktop.
Bitbucket pipelines Laravel + deployer
pipelines:
branches:
master:
- step:
name: Unit tests
image: phpunit/phpunit:6.5.3
caches:
- composer
script:
- composer install
- php -r "file_exists('.env') || copy('.env.example', '.env');"
- php artisan key:generate
- vendor/bin/phpunit -c phpunit.xml
- step:
name: Deploy
image: php:7.1.5-alpine
script:
- apk update --no-cache && apk add --no-cache openssh-client
- curl -L https://deployer.org/releases/v$DEPLOYER_VERSION/deployer.phar > /usr/local/bin/dep && chmod +x /usr/local/bin/dep
- dep deploy
DEPLOYER_VERSION=6.2.0
APP_ENV=testing
DB_CONNECTION=sqlite
DB_DATABASE=:memory:
You need to add a new SSH key (public and private) to pipelines ssh keys. And then add your hosts to Known hosts. Thats all!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment