drone
This commit is contained in:
parent
e98992ae39
commit
51c8af77cd
70
.drone.yml
70
.drone.yml
@ -2,39 +2,39 @@ kind: pipeline
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: npm install
|
||||
image: git.vaala.cloud/vaalacat/node:16-alpine
|
||||
commands:
|
||||
- |
|
||||
npm config set registry https://registry.npmmirror.com
|
||||
npm i -g pnpm
|
||||
pnpm install
|
||||
pnpm build
|
||||
pnpm export
|
||||
- name: npm install
|
||||
image: git.vaala.cloud/vaalacat/node:16-alpine
|
||||
commands:
|
||||
- |
|
||||
npm config set registry https://registry.npmmirror.com
|
||||
npm i -g pnpm
|
||||
pnpm install
|
||||
pnpm build
|
||||
pnpm export
|
||||
|
||||
- name: deploy
|
||||
image: git.vaala.cloud/vaalacat/python:3.6
|
||||
environment:
|
||||
SSH_PRIVATE_KEY:
|
||||
from_secret: SSH_PRIVATE_KEY
|
||||
SSH_TARGET:
|
||||
from_secret: SSH_TARGET
|
||||
SSH_USERNAME:
|
||||
from_secret: SSH_USERNAME
|
||||
DEPLOY_PATH:
|
||||
from_secret: DEPLOY_PATH
|
||||
commands:
|
||||
- which ssh-agent || ( apt-get update -y && apt-get install openssh-client git curl -y )
|
||||
- eval $(ssh-agent -s)
|
||||
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
||||
- mkdir -p ~/.ssh
|
||||
- chmod 700 ~/.ssh
|
||||
- ssh-keyscan $SSH_TARGET >> ~/.ssh/known_hosts
|
||||
- ssh $SSH_USERNAME@$SSH_TARGET "mkdir -p bash rm -rf /opt/vaala/static/html/$DEPLOY_PATH ;bash rm -rf /opt/vaala/static/html/$DEPLOY_PATH/*"
|
||||
- scp -r out/* $SSH_USERNAME@$SSH_TARGET:/opt/vaala/static/html/$DEPLOY_PATH
|
||||
- curl 'https://push.vaala.cloud/message/push?pushkey=PDU1TvwdaB33frA943WtFNc0EoSGTH0MhL9At&text=VaalaChatFrontDeploySuccess'
|
||||
when:
|
||||
event:
|
||||
- promote
|
||||
target:
|
||||
- production
|
||||
- name: deploy
|
||||
image: git.vaala.cloud/vaalacat/python:3.6
|
||||
environment:
|
||||
SSH_PRIVATE_KEY:
|
||||
from_secret: SSH_PRIVATE_KEY
|
||||
SSH_TARGET:
|
||||
from_secret: SSH_TARGET
|
||||
SSH_USERNAME:
|
||||
from_secret: SSH_USERNAME
|
||||
DEPLOY_PATH:
|
||||
from_secret: DEPLOY_PATH
|
||||
commands:
|
||||
- which ssh-agent || ( apt-get update -y && apt-get install openssh-client git curl -y )
|
||||
- eval $(ssh-agent -s)
|
||||
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
||||
- mkdir -p ~/.ssh
|
||||
- chmod 700 ~/.ssh
|
||||
- ssh-keyscan $SSH_TARGET >> ~/.ssh/known_hosts
|
||||
- ssh $SSH_USERNAME@$SSH_TARGET "mkdir -p bash rm -rf /opt/vaala/static/html/$DEPLOY_PATH ;bash rm -rf /opt/vaala/static/html/$DEPLOY_PATH/*"
|
||||
- scp -r out/* $SSH_USERNAME@$SSH_TARGET:/opt/vaala/static/html/$DEPLOY_PATH
|
||||
- curl 'https://push.vaala.cloud/message/push?pushkey=PDU1TvwdaB33frA943WtFNc0EoSGTH0MhL9At&text=VaalaChatFrontDeploySuccess'
|
||||
when:
|
||||
event:
|
||||
- promote
|
||||
target:
|
||||
- production
|
||||
|
Loading…
x
Reference in New Issue
Block a user