82 lines
1.4 KiB
YAML
82 lines
1.4 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: build
|
|
|
|
steps:
|
|
- name: backend
|
|
image: composer:2.1.14
|
|
commands:
|
|
- cd backend && composer install
|
|
volumes:
|
|
- name: host_docker_sock
|
|
path: /var/run/docker.sock
|
|
|
|
- name: frontend
|
|
image: node:16.13.1-alpine
|
|
commands:
|
|
- cd frontend && npm install && npm run build
|
|
volumes:
|
|
- name: host_docker_sock
|
|
path: /var/run/docker.sock
|
|
|
|
- name: build-docker-image
|
|
image: plugins/docker
|
|
settings:
|
|
dockerfile: docker/Dockerfile.drone
|
|
auto_tag: true
|
|
repo: registry.xrg.io/xrg.es
|
|
registry: https://registry.xrg.io
|
|
username:
|
|
from_secret: registry_username
|
|
password:
|
|
from_secret: registry_password
|
|
volumes:
|
|
- name: host_docker_sock
|
|
path: /var/run/docker.sock
|
|
depends_on:
|
|
- frontend
|
|
- backend
|
|
#when:
|
|
# event:
|
|
# - tag
|
|
|
|
volumes:
|
|
- name: host_docker_sock
|
|
host:
|
|
path: /var/run/docker.sock
|
|
|
|
node:
|
|
location: home
|
|
|
|
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: deploy
|
|
|
|
steps:
|
|
- name: run
|
|
image: docker/compose:1.29.2
|
|
environment:
|
|
username:
|
|
from_secret: registry_username
|
|
password:
|
|
from_secret: registry_password
|
|
commands:
|
|
- echo $username
|
|
- docker login -u $username -p $password https://registry.xrg.io
|
|
- docker-compose -f docker/docker-compose.prod.yml up -d
|
|
volumes:
|
|
- name: host_docker_sock
|
|
path: /var/run/docker.sock
|
|
|
|
volumes:
|
|
- name: host_docker_sock
|
|
host:
|
|
path: /var/run/docker.sock
|
|
|
|
node:
|
|
location: do1
|
|
|
|
depends_on:
|
|
- build
|