58 lines
1.0 KiB
YAML
58 lines
1.0 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: testing
|
|
|
|
steps:
|
|
- name: test
|
|
image: golang:1.17-buster
|
|
environment:
|
|
SNAPSHOTS_S3_ENDPOINT: minio:9000
|
|
TEST_S3_ENDPOINT: minio:9000
|
|
commands:
|
|
- 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
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
type: docker
|
|
name: Sandbox deploy
|
|
|
|
steps:
|
|
- name: build
|
|
image: golang:1.17-buster
|
|
commands:
|
|
- go mod tidy
|
|
- make build
|
|
- name: deploy
|
|
image: debian:buster
|
|
environment:
|
|
NODE: node-x.rosti.cz
|
|
SSH_KEY:
|
|
from_secret: ssh_key
|
|
commands:
|
|
- apt update && apt install -y ssh
|
|
- mkdir ~/.ssh && echo $SSH_KEY > ~/.ssh/id_key && chmod 600 ~/.ssh/id_key
|
|
- scp node-api root@$NODES:/usr/local/bin/node-api_
|
|
- ssh root@$NODES mv /usr/local/bin/node-api_ /usr/local/bin/node-api
|
|
- ssh root@$NODES systemctl restart node-api
|
|
|
|
trigger:
|
|
branch:
|
|
- main
|
|
event:
|
|
- push
|
|
- custom
|