This commit is contained in:
parent
70457ac850
commit
c5d2edf011
1 changed files with 16 additions and 38 deletions
54
.drone.yml
54
.drone.yml
|
@ -14,25 +14,14 @@ steps:
|
|||
commands:
|
||||
- npm test
|
||||
- name: deploy to prod
|
||||
image: drillster/drone-rsync
|
||||
secrets: ssh_key
|
||||
settings:
|
||||
hosts:
|
||||
- 192.168.68.120
|
||||
user: vylpes
|
||||
key:
|
||||
from_secret: ssh_key
|
||||
source: .
|
||||
target: ~/apps/card-drop/card-drop_prod
|
||||
recursive: true
|
||||
prescript:
|
||||
- eval `ssh-agent -s`
|
||||
- echo "$SSH_KEY" | tr -d '\r' | ssh-add -
|
||||
script:
|
||||
- cd ~/apps/card-drop/card-drop_prod
|
||||
- docker compose --file docker-compose.prod.yml up -d
|
||||
- sleep 10
|
||||
- pm2 restart card-drop_prod || pm2 start --name card-drop_prod dist/bot.js
|
||||
image: alpine
|
||||
secrets: [ ssh_key ]
|
||||
commands:
|
||||
- apk add rsync openssh-client
|
||||
- eval `ssh-agent -s`
|
||||
- echo "$SSH_KEY" | tr -d '\r' | ssh-add -
|
||||
- rsync -e "ssh -o StrictHostKeyChecking=no" -r ./* vylpes@192.168.68.120:/home/vylpes/apps/card-drop/card-drop_prod
|
||||
- ssh vylpes@192.168.68.120 cd ~/apps/card-drop/card-drop_prod && docker compose --file docker-compose.prod.yml up -d && sleep 10 && pm2 start --name card-drop_prod dist/bot.js
|
||||
|
||||
trigger:
|
||||
event:
|
||||
|
@ -54,25 +43,14 @@ steps:
|
|||
commands:
|
||||
- npm test
|
||||
- name: deploy to stage
|
||||
image: drillster/drone-rsync
|
||||
secrets: ssh_key
|
||||
settings:
|
||||
hosts:
|
||||
- 192.168.68.120
|
||||
user: vylpes
|
||||
key:
|
||||
from_secret: ssh_key
|
||||
source: .
|
||||
target: ~/apps/card-drop/card-drop_stage
|
||||
recursive: true
|
||||
prescript:
|
||||
- eval `ssh-agent -s`
|
||||
- echo "$SSH_KEY" | tr -d '\r' | ssh-add -
|
||||
script:
|
||||
- cd ~/apps/card-drop/card-drop_stage
|
||||
- docker compose --file docker-compose.stage.yml up -d
|
||||
- sleep 10
|
||||
- pm2 restart card-drop_stage || pm2 start --name card-drop_stage dist/bot.js
|
||||
image: alpine
|
||||
secrets: [ ssh_key ]
|
||||
commands:
|
||||
- apk add rsync openssh-client
|
||||
- eval `ssh-agent -s`
|
||||
- echo "$SSH_KEY" | tr -d '\r' | ssh-add -
|
||||
- rsync -e "ssh -o StrictHostKeyChecking=no" -r ./* vylpes@192.168.68.120:/home/vylpes/apps/card-drop/card-drop_stage
|
||||
- ssh vylpes@192.168.68.120 cd ~/apps/card-drop/card-drop_stage && docker compose --file docker-compose.stage.yml up -d && sleep 10 && pm2 start --name card-drop_stage dist/bot.js
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
|
|
Loading…
Reference in a new issue