express-template/.drone copy.yml

69 lines
1.3 KiB
YAML
Raw Normal View History

2021-08-16 15:47:37 +00:00
kind: pipeline
type: exec
name: dev-admin-backend
node:
mode: dev2
trigger:
branch: ci
steps:
- name: inject-file
environment:
ORMCONFIG:
from_secret: ORMCONFIG
ENV:
from_secret: ENV
commands:
- echo -n "$ORMCONFIG" > ormconfig.json
- echo -n "$ENV" > config/.env
- name: build
commands:
- rm package-lock.json || true
- yarn
- yarn build
- export HOME=/root
- pm2 del dev-admin-backend || true
- mkdir /opt/nodewww/dev-admin-backend || rm -rf /opt/nodewww/dev-admin-backend/*
- mv ./* /opt/nodewww/dev-admin-backend
- name: deploy
commands:
- cd /opt/nodewww/express-admin-template
- export OLDHOME=$HOME
- export HOME=/root
- pm2 start -i 0 --name dev-admin-backend ./bin/www
- pm2 startup
- pm2 save
---
kind: pipeline
type: docker
name: dev-admin-backend-builder
node:
mode: dev
trigger:
branch: ci
steps:
- name: build-docker-image
image: plugins/docker
pull: if-not-exists
settings:
username:
from_secret: docker_reg_username
password:
from_secret: docker_reg_password
repo: docker.zcj.plus/zhouchijian/express-admin-template
tags: dev
registry: https://docker.zcj.plus
depends_on:
- dev-admin-backend