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
|
|
|
|
image: public.ecr.aws/composer/composer:latest
|
|
|
|
commands:
|
|
|
|
- cd backend
|
|
|
|
- composer install
|
|
|
|
- composer dump-autoload --classmap-authoritative
|
|
|
|
- composer dump-env prod
|
|
|
|
- rm -rf var/cache
|
|
|
|
|
|
|
|
- name: build-frontend
|
|
|
|
image: public.ecr.aws/docker/library/node:16.13.1-alpine
|
|
|
|
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
|
|
|
|
image: public.ecr.aws/docker/library/busybox:latest
|
|
|
|
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
|
2022-01-10 12:11:41 +00:00
|
|
|
|
|
|
|
node:
|
2023-03-18 19:53:37 +00:00
|
|
|
location: hub
|