Skip to content

Instantly share code, notes, and snippets.

@stmn
Created February 14, 2021 22:33
Show Gist options
  • Save stmn/a6777469e14f6efea55441432464edb2 to your computer and use it in GitHub Desktop.
Save stmn/a6777469e14f6efea55441432464edb2 to your computer and use it in GitHub Desktop.
Bitbucket pipelines with deployer
image: php:7.3-fpm
pipelines:
default:
- step:
name: Node Build
image: node:14.15
caches:
- node
script:
- npm install
- npm run dev
- step:
name: App Build & Deploy
caches:
- composer
script:
- mkdir /usr/share/man/man1/
- apt-get update && apt-get install -qy git zip curl libmcrypt-dev default-mysql-client libxml2-dev default-jre wget maven openssh-client
- yes | pecl install mcrypt-1.0.2
- docker-php-ext-install pdo_mysql bcmath
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- ln -f -s .env.pipelines .env
- php artisan migrate
- php artisan serve &
- sleep 5
- ./vendor/bin/phpunit
- curl -vk http://localhost:8000
- mkdir -p ~/.ssh
- cat known_hosts >> ~/.ssh/known_hosts
- (umask 077 ; echo $SSH_KEY | base64 --decode > ~/.ssh/id_rsa)
- php vendor/bin/dep deploy dev -vvv
services:
- mysql
definitions:
services:
mysql:
image: mysql:5.7
environment:
MYSQL_DATABASE: 'homestead'
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
MYSQL_USER: 'homestead'
MYSQL_PASSWORD: 'secret'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment