ci
continuous-integration/drone/push Build was killed
Details
continuous-integration/drone/push Build was killed
Details
This commit is contained in:
parent
f7771815d8
commit
3256f2b3e4
|
@ -0,0 +1,3 @@
|
||||||
|
node_modules
|
||||||
|
.tags
|
||||||
|
.tags
|
|
@ -0,0 +1,68 @@
|
||||||
|
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
|
89
.drone.yml
89
.drone.yml
|
@ -1,68 +1,51 @@
|
||||||
kind: pipeline
|
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
|
type: docker
|
||||||
name: dev-admin-backend-builder
|
name: release
|
||||||
|
|
||||||
node:
|
node:
|
||||||
mode: dev
|
mode: dev
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch: ci
|
event:
|
||||||
|
- tag
|
||||||
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-docker-image
|
|
||||||
|
- name: build-image
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
pull: if-not-exists
|
pull: if-not-exists
|
||||||
settings:
|
settings:
|
||||||
username:
|
username:
|
||||||
from_secret: docker_reg_username
|
from_secret: repo_username
|
||||||
password:
|
password:
|
||||||
from_secret: docker_reg_password
|
from_secret: repo_password
|
||||||
repo: docker.zcj.plus/zhouchijian/express-admin-template
|
repo: docker.zcj.plus/zhouchijian/demo/express-template
|
||||||
tags: dev
|
|
||||||
registry: https://docker.zcj.plus
|
registry: https://docker.zcj.plus
|
||||||
|
|
||||||
depends_on:
|
---
|
||||||
- dev-admin-backend
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: dev
|
||||||
|
|
||||||
|
node:
|
||||||
|
mode: dev
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
branch:
|
||||||
|
- ci
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: build-image
|
||||||
|
image: plugins/docker
|
||||||
|
pull: if-not-exists
|
||||||
|
settings:
|
||||||
|
username:
|
||||||
|
from_secret: repo_username
|
||||||
|
password:
|
||||||
|
from_secret: repo_password
|
||||||
|
repo: docker.zcj.plus/zhouchijian/demo/express-template
|
||||||
|
registry: https://docker.zcj.plus
|
||||||
|
|
|
@ -62,4 +62,6 @@ typings/
|
||||||
|
|
||||||
dist
|
dist
|
||||||
|
|
||||||
ormconfig.json
|
ormconfig.json
|
||||||
|
|
||||||
|
.tags
|
|
@ -0,0 +1,16 @@
|
||||||
|
FROM node:lts-stretch
|
||||||
|
|
||||||
|
WORKDIR /src
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN cp ormconfig.example.json ormconfig.json && \
|
||||||
|
cp example.env .env && \
|
||||||
|
yarn && \
|
||||||
|
npm install pm2 -g
|
||||||
|
|
||||||
|
EXPOSE 80-60000
|
||||||
|
|
||||||
|
VOLUME ['/src']
|
||||||
|
|
||||||
|
CMD ["./pm2.sh"]
|
Loading…
Reference in New Issue