Skip to content

Commit

Permalink
fix(Makefile): bring up to date (#535)
Browse files Browse the repository at this point in the history
Bring it up to date (need to deprecate it in future though)
  • Loading branch information
yermulnik authored Jan 24, 2025
1 parent 235ea4e commit 9bf139d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
EXE := tfswitch
PKG := github.com/warrensbox/terraform-switcher
VER := $(shell git ls-remote --tags git@github.com:warrensbox/terraform-switcher.git | awk '{if ($$2 ~ "\\^\\{\\}$$") next; print vers[split($$2,vers,"\\/")]}' | sort -n -t. -k1,1 -k2,2 -k3,3 | tail -1)
VER := $(shell git ls-remote --tags --sort=version:refname git@github.com:warrensbox/terraform-switcher.git | awk '{if ($$2 ~ "\\^\\{\\}$$") next; print vers[split($$2,vers,"\\/")]}' | tail -1)
PATH := build:$(PATH)
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
Expand All @@ -11,7 +11,7 @@ $(EXE): go.mod *.go lib/*.go
.PHONY: release
release: $(EXE) darwin linux

.PHONY: darwin linux
.PHONY: darwin linux
darwin linux:
GOOS=$@ go build -ldflags "-X main.version=$(VER)" -o $(EXE)-$(VER)-$@-$(GOARCH) $(PKG)

Expand All @@ -20,16 +20,21 @@ clean:
rm -f $(EXE) $(EXE)-*-*-*

.PHONY: test
test: $(EXE)
test: vet $(EXE)
mv $(EXE) build
go test -v ./...

.PHONY: vet
vet:
go vet ./...

.PHONY: install
install: $(EXE)
mkdir -p ~/bin
mv $(EXE) ~/bin

.PHONY: docs
docs:
cd docs; bundle install --path vendor/bundler; bundle exec jekyll build -c _config.yml; cd ..
#cd docs; bundle install --path vendor/bundler; bundle exec jekyll build -c _config.yml; cd ..
cd www && mkdocs gh-deploy --force

0 comments on commit 9bf139d

Please sign in to comment.