Add CI/CD
This commit is contained in:
parent
34cd31b916
commit
65230f4fc2
78
.drone.yml
Normal file
78
.drone.yml
Normal file
@ -0,0 +1,78 @@
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: build-arm64
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: arm64
|
||||
|
||||
steps:
|
||||
- name: compile binaries
|
||||
image: golang:alpine
|
||||
commands:
|
||||
- apk --no-cache add build-base
|
||||
- go vet -v ./checker
|
||||
- go vet -v ./token-validator
|
||||
- cd ./pkg/minichecker/cmd && go vet -v . && cd -
|
||||
- cd ./pkg/login-app/cmd && go build -v . && cd -
|
||||
- mkdir dist
|
||||
- go build -v -o dist/checker ./checker
|
||||
- go build -v -o dist/token-validator ./token-validator
|
||||
- cd ./pkg/minichecker/cmd && go build -v -o ../../../dist/minichecker . && cd -
|
||||
- cd ./pkg/login-app/cmd && go build -v -o ../../../dist/login-app . && cd -
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: build-arm
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: arm
|
||||
|
||||
steps:
|
||||
- name: compile binaries
|
||||
image: golang:alpine
|
||||
commands:
|
||||
- apk --no-cache add build-base
|
||||
- go vet -v ./checker
|
||||
- go vet -v ./token-validator
|
||||
- cd ./pkg/minichecker/cmd && go vet -v . && cd -
|
||||
- cd ./pkg/login-app/cmd && go build -v . && cd -
|
||||
- mkdir dist
|
||||
- go build -v -o dist/checker ./checker
|
||||
- go build -v -o dist/token-validator ./token-validator
|
||||
- cd ./pkg/minichecker/cmd && go build -v -o ../../../dist/minichecker . && cd -
|
||||
- cd ./pkg/login-app/cmd && go build -v -o ../../../dist/login-app . && cd -
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
GOARM: 5
|
||||
|
||||
- name: deploy binaries
|
||||
image: appleboy/drone-scp
|
||||
settings:
|
||||
tar_tmp_path: /tmp/
|
||||
host: adlin.nemunai.re
|
||||
target: /var/lib/lxc/adlin/rootfs/home/newbuilds
|
||||
source: dist/*
|
||||
strip_components: 1
|
||||
username:
|
||||
from_secret: ssh_username
|
||||
key:
|
||||
from_secret: deploy_key
|
||||
port:
|
||||
from_secret: ssh_port
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- push
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
Reference in New Issue
Block a user