Merge branch 'main' into main
This commit is contained in:
commit
e76d996943
33
.drone.yml
33
.drone.yml
@ -2,7 +2,40 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: coopcloud.tech/abra
|
name: coopcloud.tech/abra
|
||||||
steps:
|
steps:
|
||||||
|
- name: make check
|
||||||
|
image: golang:1.16
|
||||||
|
commands:
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- name: make static
|
||||||
|
image: golang:1.16
|
||||||
|
ignore: true # until we decide we all want this check
|
||||||
|
environment:
|
||||||
|
STATIC_CHECK_URL: honnef.co/go/tools/cmd/staticcheck
|
||||||
|
STATIC_CHECK_VERSION: v0.2.0
|
||||||
|
commands:
|
||||||
|
- go install $STATIC_CHECK_URL@$STATIC_CHECK_VERSION
|
||||||
|
- make static
|
||||||
|
|
||||||
- name: make build
|
- name: make build
|
||||||
image: golang:1.16
|
image: golang:1.16
|
||||||
commands:
|
commands:
|
||||||
- make build
|
- make build
|
||||||
|
|
||||||
|
- name: notify on failure
|
||||||
|
image: plugins/matrix
|
||||||
|
settings:
|
||||||
|
homeserver: https://matrix.autonomic.zone
|
||||||
|
roomid: "IFazIpLtxiScqbHqoa:autonomic.zone"
|
||||||
|
userid: "@autono-bot:autonomic.zone"
|
||||||
|
accesstoken:
|
||||||
|
from_secret: autono_bot_access_token
|
||||||
|
depends_on:
|
||||||
|
- make check
|
||||||
|
- make build
|
||||||
|
when:
|
||||||
|
status:
|
||||||
|
- failure
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
22
Makefile
22
Makefile
@ -1,18 +1,28 @@
|
|||||||
|
ABRA := ./cmd/abra
|
||||||
COMMIT := $(shell git rev-list -1 HEAD)
|
COMMIT := $(shell git rev-list -1 HEAD)
|
||||||
VERSION := $(shell cat ./version)
|
|
||||||
GOPATH := $(shell go env GOPATH)
|
GOPATH := $(shell go env GOPATH)
|
||||||
|
VERSION := $(shell cat ./version)
|
||||||
LDFLAGS := "-X 'main.Commit=$(COMMIT)' -X 'main.Version=$(VERSION)'"
|
LDFLAGS := "-X 'main.Commit=$(COMMIT)' -X 'main.Version=$(VERSION)'"
|
||||||
|
|
||||||
all: run install build clean
|
all: run install build clean format check static
|
||||||
|
|
||||||
run:
|
run:
|
||||||
go run -ldflags=$(LDFLAGS) ./cmd/abra
|
@go run -ldflags=$(LDFLAGS) $(ABRA)
|
||||||
|
|
||||||
install:
|
install:
|
||||||
go install -ldflags=$(LDFLAGS) ./cmd/abra
|
@go install -ldflags=$(LDFLAGS) $(ABRA)
|
||||||
|
|
||||||
build:
|
build:
|
||||||
go build -ldflags=$(LDFLAGS) ./cmd/abra
|
@go build -ldflags=$(LDFLAGS) $(ABRA)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm '$(GOPATH)/bin/abra'
|
@rm '$(GOPATH)/bin/abra'
|
||||||
|
|
||||||
|
format:
|
||||||
|
@gofmt -s -w .
|
||||||
|
|
||||||
|
check:
|
||||||
|
@test -z $$(gofmt -l .) || (echo "gofmt: formatting issue - run 'make format' to resolve" && exit 1)
|
||||||
|
|
||||||
|
static:
|
||||||
|
@staticcheck $(ABRA)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# go-abra
|
# go-abra
|
||||||
|
|
||||||
[](https://drone.autonomic.zone/coop-cloud/go-abra)
|
[](https://drone.autonomic.zone/coop-cloud/go-abra)
|
||||||
|
[](https://goreportcard.com/report/git.autonomic.zone/coop-cloud/go-abra)
|
||||||
|
|
||||||
WIP port of [abra](https://git.autonomic.zone/coop-cloud/abra) to Golang.
|
WIP port of [abra](https://git.autonomic.zone/coop-cloud/abra) to Golang.
|
||||||
|
Reference in New Issue
Block a user