NoteCat/.drone.yml

56 lines
1.2 KiB
YAML
Raw Normal View History

2020-06-28 17:20:42 +02:00
---
kind: pipeline
type: docker
name: default
steps:
- name: install dependencies
2020-06-28 17:20:42 +02:00
image: composer
volumes:
- name: composer-cache
path: /tmp/cache
environment:
COMPOSER_CACHE_DIR: /tmp/cache
commands:
- composer install --no-progress --no-interaction
2020-06-28 17:20:42 +02:00
- name: run unit tests
2020-06-28 17:20:42 +02:00
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
2020-06-28 17:20:42 +02:00
image: docker
volumes:
- name: dockersock
path: /var/run/docker.sock
commands:
- docker build --target production -t notecat:latest .
2020-06-28 17:20:42 +02:00
- 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