Skip to content

Commit

Permalink
Merge pull request #163 from plunder-app/makefile_0_5
Browse files Browse the repository at this point in the history
Update of Makefile for v0.5
  • Loading branch information
thebsdbox authored Nov 24, 2019
2 parents 3ffadbe + 7dc3cb5 commit afdd8bf
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@ TARGET := plunder
.DEFAULT_GOAL: $(TARGET)

# These will be provided to the target
VERSION := 0.4.5
VERSION := 0.5.0
BUILD := `git rev-parse HEAD`

# Required for the move to go modules for >v0.5.0
export GO111MODULE=on

# Operating System Default (LINUX)
TARGETOS=linux

# Use linker flags to provide version/build settings to the target
LDFLAGS=-ldflags "-X=main.Version=$(VERSION) -X=main.Build=$(BUILD) -s"

SRC = "./..."
#SRC = "."

DOCKERTAG=latest

Expand All @@ -24,7 +27,7 @@ DOCKERTAG=latest
all: check install

$(TARGET): $(SRC)
@go build $(LDFLAGS) -o $(TARGET)
@go build $(LDFLAGS) -o $(TARGET) ./main.go

build: $(TARGET)
@true
Expand Down
13 changes: 13 additions & 0 deletions dockerfile/build/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

echo "Scooping up recent copy of code"

tar -cf plunder.tar ../../cmd ../../pkg ../../main.go ../../Makefile ../../go.mod ../../go.sum

docker build -t plunder:build .

docker run -it --rm plunder:build /go/bin/plunder version

echo ""
echo "Remove the code copy rm plunder.tar"
echo "Remove the local test docker container docker rmi plunder:build"
18 changes: 18 additions & 0 deletions dockerfile/build/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM golang:1.12.5

# Install the linter
RUN go get -u golang.org/x/lint/golint

RUN mkdir -p /go/src/github.com/plunder-app/plunder/dockerfile/build

WORKDIR /go/src/github.com/plunder-app/plunder/dockerfile/build

COPY plunder.tar .

RUN tar -P -xvf plunder.tar

WORKDIR /go/src/github.com/plunder-app/plunder

RUN make

#RUN /go/bin/plunder version

0 comments on commit afdd8bf

Please sign in to comment.