Skip to content
This repository has been archived by the owner on Aug 14, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
metalmatze authored Feb 19, 2021
2 parents 2954157 + c89a17d commit b19fda1
Show file tree
Hide file tree
Showing 24 changed files with 1,018 additions and 421 deletions.
8 changes: 5 additions & 3 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ workspace:
steps:
- name: build
pull: always
image: golang:1.11-alpine
image: golang:1.13-alpine
environment:
GO111MODULE: on
GOPROXY: https://proxy.golang.org
commands:
- apk add -U git make
- make build
Expand All @@ -31,9 +32,10 @@ steps:

- name: release
pull: default
image: golang:1.11-alpine
image: golang:1.13-alpine
environment:
GO111MODULE: on
GOPROXY: https://proxy.golang.org
commands:
- apk add -U git make
- make release
Expand All @@ -53,7 +55,7 @@ steps:
tag:
- latest
- 0.4
- 0.4.0
- 0.4.3
when:
event:
- tag
Expand Down
3 changes: 3 additions & 0 deletions .errcheck_excludes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(github.com/go-kit/kit/log.Logger).Log
fmt.Fprintln
fmt.Fprint
24 changes: 24 additions & 0 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: go

on:
push:
branches:
- master
pull_request:

jobs:
build-test-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: '1.16.x'
- name: build
run: make build
- name: test
run: make test
- name: lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.37
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/.env
/alertmanager-bot
/data.yml
/deployments/examples/data
/dist/
/vendor/

*coverage.out

Expand Down
36 changes: 36 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
run:
deadline: 5m
issues-exit-code: 1
skip-dirs: vendor
output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true
linters:
enable:
# Sorted alphabetically.
- deadcode
- errcheck
- goconst
- godot
- gofmt
- goimports
- gosimple
- govet
- ineffassign
- misspell
- staticcheck
- structcheck
- typecheck
- unparam
- unused
- varcheck
- exportloopref

linters-settings:
errcheck:
exclude: ./.errcheck_excludes.txt
misspell:
locale: US
goconst:
min-occurrences: 5
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## 0.4.3 / 2021-01-11

* [ENHANCEMENT] Support description annotation which is used by newer alerts [#113](https://github.com/metalmatze/alertmanager-bot/pull/113).
* [ENHANCEMENT] Create jsonnet-based deployments for Kubernets and Docker Compose [#115](https://github.com/metalmatze/alertmanager-bot/pull/115).
* [BUGFIX] Don't have a fix "EXPOSE" as the port is configurable [#106](https://github.com/metalmatze/alertmanager-bot/pull/106).

## 0.4.2 / 2020-01-11

* [BUGFIX] Fix flags with defaults that aren't required anymore [#96](https://github.com/metalmatze/alertmanager-bot/pull/96).

## 0.4.1 / 2020-01-07

Update to Go 1.13 and dependencies.

* [BUGFIX] Fix default template path [#55](https://github.com/metalmatze/alertmanager-bot/pull/55).
* [BUGFIX] Bring back defaults for flags [#93](https://github.com/metalmatze/alertmanager-bot/pull/93).

## 0.4.0 / 2019-02-19

* [FEATURE] Add ability to use templates for Telegram messages [#32](https://github.com/metalmatze/alertmanager-bot/pull/32).
Expand Down
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ RUN apk add --update ca-certificates tini
COPY ./default.tmpl /templates/default.tmpl
COPY ./alertmanager-bot /usr/bin/alertmanager-bot

EXPOSE 8080

USER nobody

ENTRYPOINT ["/sbin/tini", "--"]
Expand Down
20 changes: 15 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,11 @@ vet:

.PHONY: lint
lint:
@which golint > /dev/null; if [ $$? -ne 0 ]; then \
$(GO) get -u golang.org/x/lint/golint; \
fi
for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;
golangci-lint run

.PHONY: test
test:
@for PKG in $(PACKAGES); do $(GO) test -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done;
@for PKG in $(PACKAGES); do $(GO) test $$PKG || exit 1; done;

.PHONY: build
build:
Expand All @@ -47,3 +44,16 @@ release:
$(GO) get -u github.com/mitchellh/gox; \
fi
CGO_ENABLED=0 gox -arch="386 amd64 arm" -verbose -ldflags '-w $(LDFLAGS)' -output="dist/$(EXECUTABLE)-${DRONE_TAG}-{{.OS}}-{{.Arch}}" ./cmd/alertmanager-bot/

README.md: deployments/examples/docker-compose.yaml deployments/examples/kubernetes.yaml
embedmd -w README.md

deployments/examples/kubernetes.yaml: deployments/examples/kubernetes.jsonnet deployments/examples/values.jsonnet deployments/kubernetes.libsonnet
jsonnetfmt -i deployments/kubernetes.libsonnet
jsonnetfmt -i deployments/examples/kubernetes.jsonnet
jsonnet deployments/examples/kubernetes.jsonnet | gojsontoyaml > deployments/examples/kubernetes.yaml

deployments/examples/docker-compose.yaml: deployments/examples/docker-compose.jsonnet deployments/examples/values.jsonnet deployments/docker-compose.libsonnet
jsonnetfmt -i deployments/docker-compose.libsonnet
jsonnetfmt -i deployments/examples/docker-compose.jsonnet
jsonnet deployments/examples/docker-compose.jsonnet | gojsontoyaml > deployments/examples/docker-compose.yaml
Loading

0 comments on commit b19fda1

Please sign in to comment.