-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
111 additions
and
445 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
custom: https://www.buymeacoffee.com/ydfPU75 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: "Release" | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
docker-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Docker login | ||
run: docker login --username ${{ secrets.DOCKER_LOGIN }} --password ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Docker release | ||
run: make docker-release | ||
|
||
github-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Go | ||
uses: actions/setup-go@master | ||
with: | ||
go-version: 1.13.5 | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v1 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
before: | ||
hooks: | ||
- go mod download | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ .Tag }}" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
FROM golang:alpine as builder | ||
FROM golang:1.13.5-alpine3.10 as builder | ||
|
||
ENV GO111MODULE=on | ||
|
||
WORKDIR /go/src/github.com/mxssl/selectel_billing_exporter | ||
COPY . . | ||
|
||
# install external depends | ||
RUN apk add --no-cache ca-certificates curl git | ||
RUN CGO_ENABLED=0 GOOS=`go env GOHOSTOS` GOARCH=`go env GOHOSTARCH` go build -o app | ||
RUN apk add --no-cache \ | ||
ca-certificates \ | ||
curl \ | ||
git | ||
RUN CGO_ENABLED=0 \ | ||
GOOS=`go env GOHOSTOS` \ | ||
GOARCH=`go env GOHOSTARCH` \ | ||
go build -v -mod=vendor -o app | ||
|
||
# Copy compiled binary to clear Alpine Linux image | ||
FROM alpine:latest | ||
FROM alpine:3.11.0 | ||
WORKDIR / | ||
RUN apk add --no-cache ca-certificates | ||
RUN apk add --no-cache \ | ||
ca-certificates | ||
COPY --from=builder /go/src/github.com/mxssl/selectel_billing_exporter . | ||
RUN chmod +x app | ||
CMD ["./app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,41 @@ | ||
BINARY_NAME=app | ||
CURRENT_DIR=$(shell pwd) | ||
TAG=$(shell git name-rev --tags --name-only $(shell git rev-parse HEAD)) | ||
DOCKER_REGISTRY=mxssl | ||
export GO111MODULE=on | ||
|
||
.PHONY: all build clean lint critic test dep | ||
.PHONY: all build clean lint critic test | ||
|
||
all: build | ||
|
||
build: | ||
go build -o ${BINARY_NAME} -v | ||
chmod +x app | ||
go build -v -mod=vendor -o ${BINARY_NAME} | ||
|
||
clean: | ||
rm -f ${BINARY_NAME} | ||
|
||
lint: | ||
golangci-lint run | ||
|
||
critic: | ||
gocritic check-project ${CURRENT_DIR} | ||
golangci-lint run -v | ||
|
||
test: | ||
go test -v ./... | ||
|
||
init: | ||
GO111MODULE=on go mod init | ||
|
||
vendor: | ||
GO111MODULE=on go mod vendor | ||
go mod init | ||
|
||
tidy: | ||
GO111MODULE=on go mod tidy | ||
go mod tidy | ||
|
||
github-release-dry: | ||
@echo "TAG: ${TAG}" | ||
goreleaser release --rm-dist --snapshot --skip-publish | ||
|
||
github-release: | ||
@echo "TAG: ${TAG}" | ||
goreleaser release --rm-dist | ||
|
||
run: | ||
GO111MODULE=on go run main.go | ||
docker-release: | ||
@echo "Registry: ${DOCKER_REGISTRY}" | ||
@echo "TAG: ${TAG}" | ||
docker build --tag ${DOCKER_REGISTRY}/selectel_billing_exporter:${TAG} . | ||
docker push ${DOCKER_REGISTRY}/selectel_billing_exporter:${TAG} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
223 changes: 0 additions & 223 deletions
223
vendor/github.com/prometheus/client_golang/prometheus/promauto/auto.go
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.