Skip to content

Commit

Permalink
Remove some changes around build and git ignore for this PR
Browse files Browse the repository at this point in the history
  • Loading branch information
tateexon committed Jul 22, 2024
1 parent fcc3cb7 commit 007a1c4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ bin
*.out
coverage.txt

.vscode

imposters

!internal/server/http/test/testdata/imposters/
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
FROM golang:1.21-alpine AS build

LABEL MAINTAINER='Friends of Go (it@friendsofgo.tech)'
LABEL MAINTAINER = 'Friends of Go (it@friendsofgo.tech)'

ARG TARGETOS=linux
ARG TARGETARCH=amd64
ARG TAG=""

RUN apk add --update git
RUN apk add ca-certificates
WORKDIR /go/src/github.com/friendsofgo/killgrave
COPY . .
RUN go mod tidy \
&& if [ -z "$TAG" ]; then TAG=$(git describe --tags --abbrev=0); fi \
RUN RUN go mod tidy && TAG=$(git describe --tags --abbrev=0) \
&& LDFLAGS=$(echo "-s -w -X github.com/friendsofgo/killgrave/internal/app/cmd._version="docker-$TAG) \
&& CGO_ENABLED=0 GOOS="${TARGETOS}" GOARCH="${TARGETARCH}" go build -a -installsuffix cgo -o /go/bin/killgrave -ldflags "$LDFLAGS" cmd/killgrave/main.go

Expand Down
10 changes: 1 addition & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
.PHONY: build
build:
go build -ldflags "-s -w -X 'github.com/friendsofgo/killgrave/internal/app/cmd._version=`git rev-parse --abbrev-ref HEAD`-`git rev-parse --short HEAD`'" -o bin/killgrave cmd/killgrave/main.go

.PHONY: build-docker
build-docker:
docker build --build-arg TAG=$(TAG) -t killgrave:$(TAG) .

.PHONY: test
test:
go test -v -vet=off -race ./...
go build -ldflags "-s -w -X 'github.com/friendsofgo/killgrave/internal/app/cmd._version=`git rev-parse --abbrev-ref HEAD`-`git rev-parse --short HEAD`'" -o bin/killgrave cmd/killgrave/main.go

0 comments on commit 007a1c4

Please sign in to comment.