Compare commits
No commits in common. "7a170e56d657ca2b3642aec0c451de509ae391ce" and "a4e2bac0ff415ebedb8b417a4ad7a00b854de40e" have entirely different histories.
7a170e56d6
...
a4e2bac0ff
264
.drone.off.yml
Normal file
264
.drone.off.yml
Normal file
@ -0,0 +1,264 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: testing
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: unittests
|
||||||
|
image: golang:1.18-bullseye
|
||||||
|
environment:
|
||||||
|
SNAPSHOTS_S3_ENDPOINT: minio:9000
|
||||||
|
TEST_S3_ENDPOINT: minio:9000
|
||||||
|
volumes:
|
||||||
|
- name: dockersock
|
||||||
|
path: /var/run
|
||||||
|
commands:
|
||||||
|
- apt update && apt upgrade -y
|
||||||
|
- apt install -y tar zstd
|
||||||
|
- sleep 10
|
||||||
|
- go mod tidy
|
||||||
|
- make test
|
||||||
|
|
||||||
|
services:
|
||||||
|
- name: minio
|
||||||
|
image: minio/minio:latest
|
||||||
|
environment:
|
||||||
|
MINIO_ROOT_USER: test
|
||||||
|
MINIO_ROOT_PASSWORD: testtest
|
||||||
|
command:
|
||||||
|
- server
|
||||||
|
- /data
|
||||||
|
- --console-address
|
||||||
|
- :9001
|
||||||
|
- name: docker
|
||||||
|
image: docker:dind
|
||||||
|
privileged: true
|
||||||
|
volumes:
|
||||||
|
- name: dockersock
|
||||||
|
path: /var/run
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: dockersock
|
||||||
|
temp: {}
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: Dev deploy
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
# image: golang:1.17-buster # 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:buster
|
||||||
|
environment:
|
||||||
|
#NODE: node-x.rosti.cz
|
||||||
|
NODES: 192.168.1.236 192.168.1.220
|
||||||
|
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
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- custom
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- testing
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: Production deploy (Debian 10)
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: golang:1.17-buster # 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:buster
|
||||||
|
environment:
|
||||||
|
PROXY: saturn.rosti.cz
|
||||||
|
NODES: node-18.rosti.cz node-19.rosti.cz
|
||||||
|
SSH_KEY:
|
||||||
|
from_secret: SSH_KEY
|
||||||
|
HOST_KEYS: |
|
||||||
|
node-18.rosti.cz ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDp0KZ82dxmBJMJXuqHMiukRqVGHxyfN/nyjqPPemEz1AG2kA80od7Z9TPXYpM6Drnz0Dfcipuys7w8tbcWQGz7W+Tv1x6NWWI2r4WVfVlRkP52zdNUM/ASH88xNVmKK5FfjNyYM0khGnBcdV+ZcH/Mb7ZLLraol7B/uLahFYA5y1v+hH5ZftT8YnpOmVsx0m7PhE1zB6f5VFscSIJ5LQjhHaXkOd5zxxYJtxG6BjzqKdx5AJ2pPa6astzX4EAstpk6KzImCZ12mEEtg7bT3rLuGXg+j1DWFcHpDs0JJxF3GKGooHqbB5s26mTigqTjnytJsIzMgtfslmsLCsJGGO3B
|
||||||
|
node-18.rosti.cz ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM4ukB6uTrCzVPjsANlkD6WYoE5bNbzr62ja/nYmEKe+zvgYAb67aXLAt+pals5Hvx5cuZstQkwuTkThBcyltsg=
|
||||||
|
node-18.rosti.cz ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBAdTePM+EllZc+ZQsxuhdfiw9cRX5lAx2c9drWARSWL
|
||||||
|
node-19.rosti.cz ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6ASSidNCyGTyxlWhpm0wH/jW8a25GwAdgH29bC3pLniewTvFcKNFcW3gLjEzIb1v2um98d/OkjeUC2wBJfcoLIkfb7x3pSqQhGVYeD+vbzOMNHIEiyicnqc8bqBN/21kCaZ37KRpz2UEVgPcbawzR3v8toBUL9uSoPbnMrc6p05hTTd2zTiHPnZrmY21vQDqDYCM8YOd0KT60cSW+62B+B8t5nHOOfTZVAEvL5LK56vlFuiYDEumorSN++xpSV6IoZOKqO4WbwLh1OQn/0q85bMzkzTbBbLO7jZl1SepqbBdIg6VtsiWIWtbGf8XgBNgbNEHARoskznvL6whBiwW5
|
||||||
|
node-19.rosti.cz ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLvXp6VGcBToKNE8T1/T6ghO3MRA+lWrwCPdXRLKb1QbGKUMI/1XXdouVWNhzDdjlOeQzrAyYG9BjYdu0HS3Z9E=
|
||||||
|
node-19.rosti.cz ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC8Ti8HnOClESyv+ORPKKC23ScvyxvsPR+hInrnh8ab3
|
||||||
|
node-20.rosti.cz ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDaCUbo/dSs1jtOBpmMPYrS4fTSnMTh747JkDcRPeExREaHJiJaoKGhr7C2+tBgp/AsoIZ6Wnr9DZemNHRkb1BpAL63bqr/MRpxmanFn1hrV1/2GA79RwH6TIZ7CUe3TR0oGRX9KL+jRRGbeEC5Wqzx1nQ4wN2frkI/ZvqKsBMMRvmRC6qT1lS0w/4s4urYtzrW9AhXMx2UF+IpKo8K9MclTZ0oXggekSg04TuFT9b2DJWZFcfazm10THvC74PULvxWXh7CL22PhraMcJIwoON8rP8SEYbkV6XOUZ9ieBXZ7+kWv+leD4LsQznHGkl6eh3/A/4BC0Dlua1oiRaxsJ6V6Y033PfQIdBN3ejHEMfkgKPBCdNNi5N35JoNhnB32Tg3h6UXQjDc8I6nGu0V96PaMGOOhXRBKDT/KAsRpd781C5aTWj0fgthTBXs2IvQltPgvKvY0cpKztfZ8cjYaFBHqwDwZbRO6E2c820bWtSwb//LKcbeZV5lSl3rI8zcnsM=
|
||||||
|
node-20.rosti.cz ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFVisMN6X3k1wxeFlm9iscEy7YrFoYcYG0EORWzqArKstO0tklPQypuO7sqskjqsICoOsAgx5xQu8gPSa5C3kV8=
|
||||||
|
node-20.rosti.cz ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAa8Y7z8peAHWfFjkaKDFS4n6sKglkOtmQw7DgBMzjSt
|
||||||
|
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 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLEY5PSiOR3pklXRm0sAKc2NP2I0LZggdiRTTqrNXwUarhd7n6tdXQNf/ALh+NJ0KhcgI87Igl/jLo8YoWfeqWM=
|
||||||
|
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
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
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:
|
||||||
|
PROXY: saturn.rosti.cz
|
||||||
|
NODES: node-20.rosti.cz
|
||||||
|
SSH_KEY:
|
||||||
|
from_secret: SSH_KEY
|
||||||
|
HOST_KEYS: |
|
||||||
|
node-18.rosti.cz ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDp0KZ82dxmBJMJXuqHMiukRqVGHxyfN/nyjqPPemEz1AG2kA80od7Z9TPXYpM6Drnz0Dfcipuys7w8tbcWQGz7W+Tv1x6NWWI2r4WVfVlRkP52zdNUM/ASH88xNVmKK5FfjNyYM0khGnBcdV+ZcH/Mb7ZLLraol7B/uLahFYA5y1v+hH5ZftT8YnpOmVsx0m7PhE1zB6f5VFscSIJ5LQjhHaXkOd5zxxYJtxG6BjzqKdx5AJ2pPa6astzX4EAstpk6KzImCZ12mEEtg7bT3rLuGXg+j1DWFcHpDs0JJxF3GKGooHqbB5s26mTigqTjnytJsIzMgtfslmsLCsJGGO3B
|
||||||
|
node-18.rosti.cz ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM4ukB6uTrCzVPjsANlkD6WYoE5bNbzr62ja/nYmEKe+zvgYAb67aXLAt+pals5Hvx5cuZstQkwuTkThBcyltsg=
|
||||||
|
node-18.rosti.cz ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBAdTePM+EllZc+ZQsxuhdfiw9cRX5lAx2c9drWARSWL
|
||||||
|
node-19.rosti.cz ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6ASSidNCyGTyxlWhpm0wH/jW8a25GwAdgH29bC3pLniewTvFcKNFcW3gLjEzIb1v2um98d/OkjeUC2wBJfcoLIkfb7x3pSqQhGVYeD+vbzOMNHIEiyicnqc8bqBN/21kCaZ37KRpz2UEVgPcbawzR3v8toBUL9uSoPbnMrc6p05hTTd2zTiHPnZrmY21vQDqDYCM8YOd0KT60cSW+62B+B8t5nHOOfTZVAEvL5LK56vlFuiYDEumorSN++xpSV6IoZOKqO4WbwLh1OQn/0q85bMzkzTbBbLO7jZl1SepqbBdIg6VtsiWIWtbGf8XgBNgbNEHARoskznvL6whBiwW5
|
||||||
|
node-19.rosti.cz ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLvXp6VGcBToKNE8T1/T6ghO3MRA+lWrwCPdXRLKb1QbGKUMI/1XXdouVWNhzDdjlOeQzrAyYG9BjYdu0HS3Z9E=
|
||||||
|
node-19.rosti.cz ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC8Ti8HnOClESyv+ORPKKC23ScvyxvsPR+hInrnh8ab3
|
||||||
|
node-20.rosti.cz ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDaCUbo/dSs1jtOBpmMPYrS4fTSnMTh747JkDcRPeExREaHJiJaoKGhr7C2+tBgp/AsoIZ6Wnr9DZemNHRkb1BpAL63bqr/MRpxmanFn1hrV1/2GA79RwH6TIZ7CUe3TR0oGRX9KL+jRRGbeEC5Wqzx1nQ4wN2frkI/ZvqKsBMMRvmRC6qT1lS0w/4s4urYtzrW9AhXMx2UF+IpKo8K9MclTZ0oXggekSg04TuFT9b2DJWZFcfazm10THvC74PULvxWXh7CL22PhraMcJIwoON8rP8SEYbkV6XOUZ9ieBXZ7+kWv+leD4LsQznHGkl6eh3/A/4BC0Dlua1oiRaxsJ6V6Y033PfQIdBN3ejHEMfkgKPBCdNNi5N35JoNhnB32Tg3h6UXQjDc8I6nGu0V96PaMGOOhXRBKDT/KAsRpd781C5aTWj0fgthTBXs2IvQltPgvKvY0cpKztfZ8cjYaFBHqwDwZbRO6E2c820bWtSwb//LKcbeZV5lSl3rI8zcnsM=
|
||||||
|
node-20.rosti.cz ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFVisMN6X3k1wxeFlm9iscEy7YrFoYcYG0EORWzqArKstO0tklPQypuO7sqskjqsICoOsAgx5xQu8gPSa5C3kV8=
|
||||||
|
node-20.rosti.cz ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAa8Y7z8peAHWfFjkaKDFS4n6sKglkOtmQw7DgBMzjSt
|
||||||
|
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 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLEY5PSiOR3pklXRm0sAKc2NP2I0LZggdiRTTqrNXwUarhd7n6tdXQNf/ALh+NJ0KhcgI87Igl/jLo8YoWfeqWM=
|
||||||
|
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
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
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 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLEY5PSiOR3pklXRm0sAKc2NP2I0LZggdiRTTqrNXwUarhd7n6tdXQNf/ALh+NJ0KhcgI87Igl/jLo8YoWfeqWM=
|
||||||
|
node-22.rosti.cz ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC6zxrqgmr6kjCShUYBMRSjjKPSZE3useQVMF1WrvMBhW/XIme1S4TXn7EtFmfg90g85AV17OSZfHH4CFjFvtxnp9rsBXUBp3Tzr8i57ZmvEf8CcwdFTtw0Qn49PVL05whUCLQGNq+EvdP4OnkZ4B3UfZ6D7N/Ho7zrsdzjjosoFwui16IeWVEYwF2Ci2RHMDyb8tLytHWJkortaAB1hFzKTDQcInTIFjQsltAsR3EH8R0Y8y8hOTUIm2HK+DGmAbGxNU2u+HPwLrsBx959P94WY5vGIWGzhTNq/W++OfkfoWavPikNxo3vhJ82XYvs1zgY4pBLOSAxPHV0QSoFRRIWr2Pt4gZY7O49scjAIWa+7ATHPrMLSKRhlFB3lwBajmvFwfPjxF6RNLeU0PC5Mg8i8Gmgl4bpopoAgTMIdlMmpzhdS+WTKtqMrmRo/oBX2OIcyp9aY8g9mFe6gROy/yrq+H3hxeZPSlbC64IV4rlPkKwnVc3m6f4J36cgegw0PYs=
|
||||||
|
node-22.rosti.cz ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKAxx5CrdBNX3N07f4tvAbEXr2CZedOtERzo5DngdIj1PejgJco0jKjzf6kvhoHKK5TRDGazXuySr0jUFvedB6g=
|
||||||
|
node-22.rosti.cz ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOjnVrKhgmdbKf3m49xPGPEC46DsdHITIrSKcReLxwDL
|
||||||
|
node-23.rosti.cz ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDZXbjDFPvp1BiPHk09/DQW4eF+RzakpM/94JuGq+cT1O876dRnkZ4ZjZRbuu5u3r1da2yRM6Sz/hSCPvjU9c6xg82QFjXSG6WFnp59/wSOK8iGQPk5rXiZWl17GAiPaCvtYixQ6RbDozljDTcg+c6SaDwgvnDxdy3s3KyEGcpvSTtJoNlIDV6LYb261sGIMAY2Gzcwn4gZSX6xEdvwsInsoLWO3JD8lDrSd1bS2HptwXDVkEe1uMS3SNZfi4OCme7MRTw+EV11wBFodq2TE+jg8RMPDRM165AQn7WDdI0q0OKIEZ0wydmnhVjL8lUdIBGD8rOCkUQr2lqW+TBxCh9m5WzV81PLfilHJy1MHZNffiSrkKktuFvIDr848goxnPdkBkt1J4SATSEAygqcX8a4f59R3YM5iO1OqEOoP4jbw6eO675h8ON2/wXAR14a1Pp5kVKXMALqi93HuWfnkk/5/p+Zew1Xlndarq3g8PudLzzmEOINPYKPsIhMTwKQSec=
|
||||||
|
node-23.rosti.cz ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEP/VYaCRHFHNDDS870AUBTeI9rigLUB8wqoVCYtx6++bSztWqx8aHNjokVSXBwhBrWKK+UXiBMCxd/1hMnGgRw=
|
||||||
|
node-23.rosti.cz ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBRFZyIvMy1hJs7IL13VwNHoxKk35I7Y0enJ2TBAj/r2
|
||||||
|
node-24.rosti.cz ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQClN27YKYii8+Tp2Q4VO8mruA/ixeCZBZulxIZH+tT+G2MuvQrupS8gK/ieZWKUzqt70Fjwof787S7IIkokNHGdZi8ix/lhJYVS1k/bZ1kYrImUsphY7kSXEyI8M8OOANo0HnZ/yK047scEuH5yR/fPjrZffq/HzckCl6BUy8ggumb74dNMUaZw3QC3hc7YQbFdZP2dYtaDrSQrN70mfxl1pufTHHuhipxd4yO5qXh8eowwy7BpzGGFDox7u/EAXX0Owow5fo/EPcmhZnnPiY/juR5uyq6jHuxAkD9FLA7Ot55OyrtWHsH4ee8Ks+Jiu9wVZqpMDROcB/PJ1jOD/ust/Nd1A33FM4uOlePc1WUDpUvrwm+JC9OlD30YwxMbRmIfp57wSuU4bk+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
|
3
main.go
3
main.go
@ -43,7 +43,6 @@ func _init() {
|
|||||||
// Connect to the NATS service
|
// Connect to the NATS service
|
||||||
nc, err = nats.Connect(config.NATSURL)
|
nc, err = nats.Connect(config.NATSURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
sentry.CaptureException(err)
|
|
||||||
log.Fatalln(err)
|
log.Fatalln(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +103,6 @@ func main() {
|
|||||||
start := time.Now()
|
start := time.Now()
|
||||||
err := statsProcessor.GatherStats()
|
err := statsProcessor.GatherStats()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
sentry.CaptureException(err)
|
|
||||||
log.Println("LOOP ERROR:", err.Error())
|
log.Println("LOOP ERROR:", err.Error())
|
||||||
}
|
}
|
||||||
elapsed := time.Since(start)
|
elapsed := time.Since(start)
|
||||||
@ -119,7 +117,6 @@ func main() {
|
|||||||
for {
|
for {
|
||||||
err := nodeProcessor.Log()
|
err := nodeProcessor.Log()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
sentry.CaptureException(err)
|
|
||||||
log.Println("NODE PERFORMANCE LOG ERROR:", err.Error())
|
log.Println("NODE PERFORMANCE LOG ERROR:", err.Error())
|
||||||
}
|
}
|
||||||
time.Sleep(5 * time.Minute)
|
time.Sleep(5 * time.Minute)
|
||||||
|
Loading…
Reference in New Issue
Block a user