github.com/jkawamoto/roadie-azure@v0.3.5/Makefile (about)

     1  #
     2  # Makefile
     3  #
     4  # Copyright (c) 2017 Junpei Kawamoto
     5  #
     6  # This file is part of Roadie Azure.
     7  #
     8  # Roadie Azure is free software: you can redistribute it and/or modify
     9  # it under the terms of the GNU General Public License as published by
    10  # the Free Software Foundation, either version 3 of the License, or
    11  # (at your option) any later version.
    12  #
    13  # Roadie Azure is distributed in the hope that it will be useful,
    14  # but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  # GNU General Public License for more details.
    17  #
    18  # You should have received a copy of the GNU General Public License
    19  # along with Roadie Azure.  If not, see <http:#www.gnu.org/licenses/>.
    20  #
    21  VERSION := $(shell git describe --abbrev=0 --tags)
    22  GHRFLAGS =
    23  default: build
    24  .PHONY: asset build release get-deps test
    25  
    26  asset: get-deps
    27  	rm assets/assets.go
    28  	go-bindata -pkg assets -o assets/assets.go -nometadata assets/*
    29  
    30  build: asset
    31  	mkdir -p pkg/$(VERSION)/roadie-azure_linux_amd64
    32  	GOOS=linux GOARCH=amd64 go build -o pkg/$(VERSION)/roadie-azure_linux_amd64/roadie-azure
    33  	cd pkg/$(VERSION) && tar -zcvf roadie-azure_linux_amd64.tar.gz roadie-azure_linux_amd64
    34  	rm -r pkg/$(VERSION)/roadie-azure_linux_amd64
    35  
    36  release: build
    37  	ghr -u jkawamoto $(GHRFLAGS) v$(VERSION) pkg/$(VERSION)
    38  
    39  get-deps:
    40  	go get -d -t -v .
    41  	go get -u github.com/jteeuwen/go-bindata/...
    42  
    43  test: asset
    44  	go test -v ./... -tags dummy