56 lines
1.2 KiB
YAML
56 lines
1.2 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
steps:
|
|
- name: install dependencies
|
|
image: composer
|
|
volumes:
|
|
- name: composer-cache
|
|
path: /tmp/cache
|
|
environment:
|
|
COMPOSER_CACHE_DIR: /tmp/cache
|
|
commands:
|
|
- composer install --no-progress --no-interaction
|
|
|
|
- name: run unit tests
|
|
image: php:7.4
|
|
commands:
|
|
- vendor/bin/phpunit -c phpunit.xml
|
|
|
|
- name: remove dev dependencies
|
|
image: composer
|
|
volumes:
|
|
- name: composer-cache
|
|
path: /tmp/cache
|
|
environment:
|
|
COMPOSER_CACHE_DIR: /tmp/cache
|
|
commands:
|
|
- composer install --no-progress --no-interaction --no-dev --optimize-autoloader
|
|
|
|
- name: build production image
|
|
image: docker
|
|
volumes:
|
|
- name: dockersock
|
|
path: /var/run/docker.sock
|
|
commands:
|
|
- docker build --target production -t notecat:latest .
|
|
|
|
- name: deploy on testing
|
|
image: docker/compose
|
|
volumes:
|
|
- name: dockersock
|
|
path: /var/run/docker.sock
|
|
commands:
|
|
- docker-compose -f docker/docker-compose.testing.yml up --build --detach
|
|
|
|
volumes:
|
|
- name: composer-cache
|
|
host:
|
|
path: /tmp/drone/composer-cache
|
|
|
|
- name: dockersock
|
|
host:
|
|
path: /var/run/docker.sock
|