Skip to content

Commit

Permalink
Fix incorrect version (#76)
Browse files Browse the repository at this point in the history
* Fix incorrect version.

* FIx for releaser itself.

* Removing promu.

* Delete another file related to promu.

* update ldflags

update ldflags to fill correct values for version

* Remove make build.

* Tidy.

* Revert "Tidy."

This reverts commit 472ca26.

* add prometheus again

* add required packages

* Remove make tarball from CI.

* Remove make tarball

* trigger

Co-authored-by: Denys Kondratenko <denisok@users.noreply.github.com>
  • Loading branch information
JiriCtvrtka and denisok authored Jan 5, 2022
1 parent 042c76f commit ba07128
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 51 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ jobs:
echo "$HOME/gotip/bin" >> $GITHUB_PATH
- name: Checkout code
uses: percona-platform/checkout@v2
- name: Build
run: make build
- name: Run checks
run: |
go build -modfile=tools/go.mod -o bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint
Expand All @@ -54,10 +52,6 @@ jobs:
AWS_ACCESS_KEY: AKIAZPBRO3QWCEHJTL35
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
run: make codecov
- name: Build tarball
run: make tarball
- name: Build tarball
run: make docker
- name: Run debug commands on failure
if: ${{ failure() }}
run: |
Expand Down
6 changes: 5 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ builds:
flags:
- -v
ldflags:
- -s -w -X main.version=v{{.Version}} -X main.commit={{.ShortCommit}} -X main.buildDate={{.Date}}
- -s -w
- -X github.com/prometheus/common/version.Version={{ .Version }}
- -X github.com/prometheus/common/version.Revision={{ .ShortCommit }}
- -X github.com/prometheus/common/version.Branch={{ .Branch }}
- -X github.com/prometheus/common/version.BuildDate={{ .Date }}
archives:
- name_template: "{{ .ProjectName }}-{{ .Version }}.{{ .Os }}-{{ .Arch }}"
wrap_in_directory: true
Expand Down
22 changes: 0 additions & 22 deletions .promu.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM golang:1.16 as build

COPY . /usr/src/rds_exporter

RUN cd /usr/src/rds_exporter && make build
RUN cd /usr/src/rds_exporter

FROM alpine:latest

Expand Down
16 changes: 0 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# limitations under the License.

GO := go
PROMU := bin/promu
pkgs = $(shell $(GO) list ./...)

PREFIX ?= $(shell pwd)
Expand Down Expand Up @@ -42,23 +41,10 @@ vet:
@echo ">> vetting code"
@$(GO) vet $(pkgs)

build: promu
@echo ">> building binaries"
@$(PROMU) build --prefix $(PREFIX)

tarball: promu
@echo ">> building release tarball"
@$(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR)

docker:
@echo ">> building docker image $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)"
@docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" .

promu:
@GOOS=$(shell uname -s | tr A-Z a-z) \
GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \
$(GO) build -modfile=tools/go.mod -o bin/promu github.com/prometheus/promu

check:
bin/golangci-lint run -c=.golangci.yml --out-format=line-number

Expand All @@ -68,5 +54,3 @@ codecov: gocoverutil

gocoverutil:
@$(GO) build -modfile=tools/go.mod -o bin/gocoverutil github.com/AlekSi/gocoverutil

.PHONY: all style format build test vet tarball docker promu
4 changes: 3 additions & 1 deletion tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ go 1.15
require (
github.com/AlekSi/gocoverutil v0.2.0
github.com/golangci/golangci-lint v1.40.1
github.com/prometheus/promu v0.12.0
github.com/prometheus/client_golang v1.7.1 // indirect
github.com/reviewdog/reviewdog v0.11.0
google.golang.org/api v0.33.0 // indirect
google.golang.org/grpc v1.32.0 // indirect
)
4 changes: 2 additions & 2 deletions tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA=
github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.19.0 h1:Itb4+NjG9wRdkAWgVucbM/adyIXxEhbw0866e0uZE6A=
github.com/prometheus/common v0.19.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
Expand All @@ -651,8 +652,6 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/prometheus/promu v0.12.0 h1:Y0zJJfaZo1i4SaLVFpcqUrkLUdeJyGGYkuJ3Q+IvDrE=
github.com/prometheus/promu v0.12.0/go.mod h1:pO1U0Qd0Id6Gt2xBrtsuyJ2L3q1hbTMx/o3phrr0pY4=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/pseudomuto/protoc-gen-doc v1.3.2/go.mod h1:y5+P6n3iGrbKG+9O04V5ld71in3v/bX88wUwgt+U8EA=
github.com/pseudomuto/protokit v0.2.0/go.mod h1:2PdH30hxVHsup8KpBTOXTBeMVhJZVio3Q8ViKSAXT0Q=
Expand Down Expand Up @@ -932,6 +931,7 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 h1:ld7aEMNHoBnnDAX15v1T6z31v8HwR2A9FYOuAhWqkwc=
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84 h1:duBc5zuJsmJXYOVVE/6PxejI+N3AaCqKjtsoLn1Je5Q=
golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
Expand Down
3 changes: 1 addition & 2 deletions tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
package tools

import (
_ "github.com/AlekSi/gocoverutil"
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"
_ "github.com/prometheus/promu"
_ "github.com/reviewdog/reviewdog/cmd/reviewdog"
_ "github.com/AlekSi/gocoverutil"
)

0 comments on commit ba07128

Please sign in to comment.