Skip to content

Commit 6420211

Browse files
author
Jon Shanks
committed
Fix makefile build
1 parent af00c7a commit 6420211

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

.circleci/config.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ jobs:
1515
working_directory: /go/src/github.com/appvia/aws_usersync
1616
steps:
1717
- checkout
18-
- run: go get github.com/mitchellh/gox
1918
- run: go get github.com/tcnksm/ghr
2019
- run: mkdir ./bin
21-
- run: gox -osarch="linux/amd64" -output=./bin/$CIRCLE_PROJECT_REPONAME-$CIRCLE_TAG
20+
- run: make static
2221
- run: git config --global user.name jon-shanks
2322
- run: ghr $CIRCLE_TAG ./bin/
2423

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ROOT_DIR=${PWD}
66
HARDWARE=$(shell uname -m)
77
GIT_SHA=$(shell git --no-pager describe --always --dirty)
88
BUILD_TIME=$(shell date -u '+%Y-%m-%d_%I:%M:%S%p')
9-
VERSION ?= $(shell awk '/Version.*=/ { print $$3 }' cmd/aws_usersync/main.go | sed 's/"//g')
9+
VERSION ?= $(shell awk '/version .*=/ { print $$3 }' cmd/aws_usersync/main.go | sed 's/"//g')
1010
DEPS=$(shell go list -f '{{range .TestImports}}{{.}} {{end}}' ./...)
1111
PACKAGES=$(shell go list ./...)
1212
LFLAGS ?= -X main.GitSHA=${GIT_SHA}
@@ -32,7 +32,7 @@ build:
3232
static: golang deps
3333
@echo "--> Compiling the static binary"
3434
mkdir -p bin
35-
CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags "-w ${LFLAGS}" -o bin/${NAME} cmd/${NAME}/*.go
35+
CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags "-w ${LFLAGS}" -o bin/${NAME}-${VERSION}-linux-amd64 cmd/${NAME}/*.go
3636

3737
docker-release:
3838
@echo "--> Building a release image"

0 commit comments

Comments
 (0)