Different pipeline for Debian 11
This commit is contained in:
parent
1017288a4c
commit
69e147ccf9
1 changed files with 47 additions and 2 deletions
49
.drone.yml
49
.drone.yml
|
@ -88,7 +88,7 @@ depends_on:
|
|||
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: Production deploy
|
||||
name: Production deploy (Debian 10)
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
|
@ -101,7 +101,52 @@ steps:
|
|||
- name: deploy
|
||||
image: debian:buster
|
||||
environment:
|
||||
NODES: node-18.rosti.cz node-19.rosti.cz node-20.rosti.cz
|
||||
NODES: node-18.rosti.cz node-19.rosti.cz
|
||||
SSH_KEY:
|
||||
from_secret: SSH_KEY
|
||||
commands:
|
||||
- apt update && apt install -y ssh
|
||||
- |
|
||||
for NODE in $NODES; do
|
||||
echo "\033[0;32mDeploying $NODE\033[0m"
|
||||
mkdir -p ~/.ssh && echo "$SSH_KEY" > ~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519
|
||||
echo "\033[1;33m.. scanning SSH keys\033[0m"
|
||||
ssh-keyscan $NODE > ~/.ssh/known_hosts
|
||||
echo "\033[1;33m.. copying the binary\033[0m"
|
||||
scp node-api root@$NODE:/usr/local/bin/node-api_
|
||||
echo "\033[1;33m.. replacing the binary\033[0m"
|
||||
ssh root@$NODE mv /usr/local/bin/node-api_ /usr/local/bin/node-api
|
||||
echo "\033[1;33m.. restarting service\033[0m"
|
||||
ssh root@$NODE systemctl restart node-api
|
||||
done
|
||||
|
||||
depends_on:
|
||||
- testing
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- promote
|
||||
target:
|
||||
- production
|
||||
|
||||
---
|
||||
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: Production deploy (Debian 11)
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: golang:1.18-bullseye # this one is used in production
|
||||
#image: golang:1.17-bullseye # this one is used in dev
|
||||
commands:
|
||||
- go mod tidy
|
||||
- make build
|
||||
|
||||
- name: deploy
|
||||
image: debian:bullseye
|
||||
environment:
|
||||
NODES: node-20.rosti.cz
|
||||
SSH_KEY:
|
||||
from_secret: SSH_KEY
|
||||
commands:
|
||||
|
|
Loading…
Reference in a new issue