2022-01-09 11:08:42 +00:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
2022-01-10 12:11:41 +00:00
|
|
|
name: build
|
2022-01-09 11:08:42 +00:00
|
|
|
|
|
|
|
steps:
|
2022-01-10 07:00:40 +00:00
|
|
|
- name: backend
|
2022-01-10 10:53:25 +00:00
|
|
|
image: composer:2.1.14
|
2022-01-09 11:16:43 +00:00
|
|
|
commands:
|
2022-01-11 15:49:13 +00:00
|
|
|
- ln -s /drone/src /var/www && cd /var/www/backend && composer install && composer dump-autoload --classmap-authoritative && composer dump-env prod
|
2022-01-10 07:00:40 +00:00
|
|
|
|
|
|
|
- name: frontend
|
2022-01-10 10:51:12 +00:00
|
|
|
image: node:16.13.1-alpine
|
2022-01-10 07:00:40 +00:00
|
|
|
commands:
|
|
|
|
- cd frontend && npm install && npm run build
|
|
|
|
|
2022-01-11 07:16:54 +00:00
|
|
|
- name: build-php-image
|
2022-01-10 07:31:06 +00:00
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
2022-01-11 07:16:54 +00:00
|
|
|
dockerfile: docker/Dockerfile.php
|
|
|
|
auto_tag: true
|
2022-01-11 07:35:48 +00:00
|
|
|
repo: registry.xrg.io/xrges/php
|
2022-01-11 07:16:54 +00:00
|
|
|
registry: https://registry.xrg.io
|
|
|
|
username:
|
|
|
|
from_secret: registry_username
|
|
|
|
password:
|
|
|
|
from_secret: registry_password
|
|
|
|
depends_on:
|
|
|
|
- frontend
|
|
|
|
- backend
|
|
|
|
|
|
|
|
- name: build-nginx-image
|
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
|
|
|
dockerfile: docker/Dockerfile.nginx
|
|
|
|
auto_tag: true
|
2022-01-11 07:35:48 +00:00
|
|
|
repo: registry.xrg.io/xrges/nginx
|
2022-01-11 07:16:54 +00:00
|
|
|
registry: https://registry.xrg.io
|
|
|
|
username:
|
|
|
|
from_secret: registry_username
|
|
|
|
password:
|
|
|
|
from_secret: registry_password
|
|
|
|
depends_on:
|
|
|
|
- frontend
|
|
|
|
- backend
|
|
|
|
|
|
|
|
- name: build-redis-image
|
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
|
|
|
dockerfile: docker/Dockerfile.redis
|
2022-01-10 07:31:06 +00:00
|
|
|
auto_tag: true
|
2022-01-11 07:35:48 +00:00
|
|
|
repo: registry.xrg.io/xrges/redis
|
2022-01-10 07:31:06 +00:00
|
|
|
registry: https://registry.xrg.io
|
|
|
|
username:
|
|
|
|
from_secret: registry_username
|
|
|
|
password:
|
|
|
|
from_secret: registry_password
|
2022-01-10 11:56:42 +00:00
|
|
|
depends_on:
|
|
|
|
- frontend
|
|
|
|
- backend
|
2022-01-10 11:03:30 +00:00
|
|
|
|
2022-01-10 11:59:58 +00:00
|
|
|
node:
|
2022-01-10 12:11:41 +00:00
|
|
|
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
|
2022-01-11 08:13:48 +00:00
|
|
|
- docker-compose -f docker/docker-compose.prod.yml stop
|
2022-01-11 08:25:31 +00:00
|
|
|
#- docker-compose -f docker/docker-compose.prod.yml rm -f
|
2022-01-11 08:13:48 +00:00
|
|
|
- docker-compose -f docker/docker-compose.prod.yml pull
|
2022-01-10 12:48:33 +00:00
|
|
|
- docker-compose -f docker/docker-compose.prod.yml up -d
|
2022-01-10 12:11:41 +00:00
|
|
|
volumes:
|
2022-01-10 12:41:59 +00:00
|
|
|
- name: host_docker_sock
|
|
|
|
path: /var/run/docker.sock
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: host_docker_sock
|
|
|
|
host:
|
2022-01-10 12:11:41 +00:00
|
|
|
path: /var/run/docker.sock
|
|
|
|
|
|
|
|
node:
|
|
|
|
location: do1
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- build
|