44 lines
823 B
YAML
44 lines
823 B
YAML
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
steps:
|
|
- name: lint
|
|
image: golangci/golangci-lint:latest
|
|
volumes:
|
|
- name: cache
|
|
path: /go
|
|
commands:
|
|
- go get -v ./...
|
|
- golangci-lint run
|
|
|
|
- name: test
|
|
image: golang:1.17
|
|
volumes:
|
|
- name: cache
|
|
path: /go
|
|
pull: true
|
|
commands:
|
|
- go test -v ./...
|
|
|
|
- name: deploy
|
|
image: golang:1.17
|
|
volumes:
|
|
- name: cache
|
|
path: /go
|
|
commands:
|
|
- apt-get update && apt-get install -y rsync
|
|
- echo "$PRIVATE_KEY" | tr '_' '\n' > ./id_ci && chmod 600 ./id_ci
|
|
- deploy/scripts/build.sh
|
|
- deploy/scripts/push.sh -p $SERVER_PORT -i ./id_ci $SERVER_ADDRESS
|
|
environment:
|
|
SERVER_PORT:
|
|
from_secret: server_port
|
|
SERVER_ADDRESS:
|
|
from_secret: server_address
|
|
PRIVATE_KEY:
|
|
from_secret: private_key
|
|
|
|
volumes:
|
|
- name: cache
|
|
temp: {} |