Add support for Debian 12 builds
All checks were successful
continuous-integration/drone Build is passing
continuous-integration/drone/promote/production Build is passing

This commit is contained in:
Adam Štrauch 2023-09-16 11:40:34 +02:00
parent 0b5ded2abf
commit dab9b52953
Signed by: cx
GPG key ID: 018304FFA8988F8D

View file

@ -204,3 +204,61 @@ trigger:
- promote
target:
- production
---
kind: pipeline
type: docker
name: Production deploy (Debian 12)
steps:
- name: build
image: golang:1.20-bookworm # this one is used in production
commands:
- go mod tidy
- make build
- name: deploy
image: debian:bookworm
environment:
PROXY: saturn.rosti.cz
NODES: node-22.rosti.cz node-23.rosti.cz node-24.rosti.cz
SSH_KEY:
from_secret: SSH_KEY
HOST_KEYS: |
saturn.rosti.cz ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBkkSH4ZExipcArbSR0TdtdW5JhHf+oeuPRJ3VkFKUIN
saturn.rosti.cz ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC9aRaEQTSKkKnJayODbwIg4BynK0WTvHWzp9UZzvmPxDjh1NpE/3G4Yi6tdZhJ7WjFotxxav7LBotIHu0s6jlVTDtnJ1lN4XBWFzympiZr1SJ12AdUuiC+f5drFTmywWL2YskFyVRYrfguXyGsavu63EokrezoTrCPASaOVmnhvrND9MJNcAgUm/kH+713XIQXWuK27zlrU6VTFSrr1nvDGn10ZaJULQ2XVhNfoysJSDU3nDyxM02qwDQp2cZ0J5fkgvvlvACHDnGgX1e+lHPhyZFhOmTiz7e4fXTuzkzUgjdih4NNDJdm1Em/25L9flnunzHtjvKNqtIL0nFxtJzN0TFRuO1BrykIMYBYBlofJYwc4ssgm8+eSxzjF8W/0rhsoq8JmFWVAvUYrMLCAejHvhG76/BNFEbGPfjt7SdwRVcr1BcgWlDDlNogPESIM1/9SzGi/IYEPKwIemrLRNw2X8QLJ5y2cr7PHTYSVp2NRlyrwvBD64rHIfKiRp/YPNc=
saturn.rosti.cz ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYA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YwxMbRmIfp57wSuU4bk+AFfrQZ/cwkEZmI/jYgiJwdcflNe7oFSOEn45fX/QNRK784+GHgdg+rY+Ce2YYKUCNpi9BITUnQGG61hhSrLJ8VVCEtJSaHb9r2VC/YNAxAsnd6fuW5Vk=
node-24.rosti.cz ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGZRGv88qAG0AGRf0d77ChSU2DbDN84LZMCOWPss3RUlRvO72DJSp2706pEpbznDFSoawZ00dY0nH0p09U5ddZY=
node-24.rosti.cz ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKFw8qvLWdwOan2PHVNl8a+az2mbrzRhtFReUu84Uy3o
commands:
- apt update && apt install -y ssh rsync
- |
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.. setting up SSH host keys\033[0m"
echo "$HOST_KEYS" > ~/.ssh/known_hosts
echo "\033[1;33m.. copying the binary\033[0m"
rsync -ave "ssh -J root@$PROXY" node-api root@$NODE:/usr/local/bin/node-api_
echo "\033[1;33m.. replacing the binary\033[0m"
ssh -J root@$PROXY root@$NODE mv /usr/local/bin/node-api_ /usr/local/bin/node-api
echo "\033[1;33m.. restarting service\033[0m"
ssh -J root@$PROXY root@$NODE systemctl restart node-api
done
depends_on:
- testing
trigger:
event:
- promote
target:
- production