diff --git a/.circleci/config.yml b/.circleci/config.yml index 14313ee..132be3b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,10 +15,9 @@ jobs: working_directory: /go/src/github.com/appvia/aws_usersync steps: - checkout - - run: go get github.com/mitchellh/gox - run: go get github.com/tcnksm/ghr - run: mkdir ./bin - - run: gox -osarch="linux/amd64" -output=./bin/$CIRCLE_PROJECT_REPONAME-$CIRCLE_TAG + - run: make static - run: git config --global user.name jon-shanks - run: ghr $CIRCLE_TAG ./bin/ diff --git a/Makefile b/Makefile index 44f386d..5c93930 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ ROOT_DIR=${PWD} HARDWARE=$(shell uname -m) GIT_SHA=$(shell git --no-pager describe --always --dirty) BUILD_TIME=$(shell date -u '+%Y-%m-%d_%I:%M:%S%p') -VERSION ?= $(shell awk '/Version.*=/ { print $$3 }' cmd/aws_usersync/main.go | sed 's/"//g') +VERSION ?= $(shell awk '/version .*=/ { print $$3 }' cmd/aws_usersync/main.go | sed 's/"//g') DEPS=$(shell go list -f '{{range .TestImports}}{{.}} {{end}}' ./...) PACKAGES=$(shell go list ./...) LFLAGS ?= -X main.GitSHA=${GIT_SHA} @@ -32,7 +32,7 @@ build: static: golang deps @echo "--> Compiling the static binary" mkdir -p bin - CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags "-w ${LFLAGS}" -o bin/${NAME} cmd/${NAME}/*.go + CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags "-w ${LFLAGS}" -o bin/${NAME}-${VERSION}-linux-amd64 cmd/${NAME}/*.go docker-release: @echo "--> Building a release image"