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:
|
2023-03-18 19:53:37 +00:00
|
|
|
- name: build-backend
|
2023-08-14 13:30:11 +00:00
|
|
|
image: composer:latest
|
2023-03-18 19:53:37 +00:00
|
|
|
commands:
|
|
|
|
- cd backend
|
|
|
|
- composer install
|
|
|
|
- composer dump-autoload --classmap-authoritative
|
|
|
|
- composer dump-env prod
|
|
|
|
- rm -rf var/cache
|
|
|
|
|
|
|
|
- name: build-frontend
|
2023-08-14 13:30:11 +00:00
|
|
|
image: node:16.13.1-alpine
|
2023-03-18 19:53:37 +00:00
|
|
|
commands:
|
|
|
|
- cd frontend
|
|
|
|
- npm install
|
|
|
|
- REACT_APP_GIT_SHA="${DRONE_COMMIT_SHA:0:10}" npm run build
|
|
|
|
volumes:
|
|
|
|
- name: cache
|
|
|
|
path: /drone/src/frontend/node_modules
|
|
|
|
|
|
|
|
- name: deploy-to-volume
|
2023-08-14 13:30:11 +00:00
|
|
|
image: busybox:latest
|
2023-03-18 19:53:37 +00:00
|
|
|
commands:
|
|
|
|
- rm -rf /var/www-xrg.es/*
|
2023-03-18 20:05:05 +00:00
|
|
|
- mv backend /var/www-xrg.es/backend
|
|
|
|
- mv frontend/build /var/www-xrg.es/frontend
|
2023-03-18 20:21:25 +00:00
|
|
|
- chown -R 82:82 /var/www-xrg.es/backend/var
|
2022-01-10 12:11:41 +00:00
|
|
|
|
|
|
|
node:
|
2023-08-14 13:30:11 +00:00
|
|
|
location: nexus
|