github.com/fanux/shipyard@v0.0.0-20161009071005-6515ce223235/Makefile (about)

     1  CGO_ENABLED=0
     2  GOOS=linux
     3  GOARCH=amd64
     4  TAG?=latest
     5  COMMIT=`git rev-parse --short HEAD`
     6  
     7  all: build media
     8  
     9  clean:
    10  	@rm -rf controller/controller
    11  
    12  build:
    13  	@cd controller && godep go build -a -tags "netgo static_build" -installsuffix netgo -ldflags "-w -X github.com/shipyard/shipyard/version.GitCommit=$(COMMIT)" .
    14  
    15  remote-build:
    16  	@docker build -t shipyard-build -f Dockerfile.build .
    17  	@rm -f ./controller/controller
    18  	@cd controller && docker run --rm -w /go/src/github.com/shipyard/shipyard --entrypoint /bin/bash shipyard-build -c "make build 1>&2 && cd controller && tar -czf - controller" | tar zxf -
    19  
    20  media:
    21  	@cd controller/static && bower -s install --allow-root -p | xargs echo > /dev/null
    22  
    23  image: media build
    24  	@echo Building Shipyard image $(TAG)
    25  	@cd controller && docker build -t shipyard/shipyard:$(TAG) .
    26  
    27  release: build image
    28  	@docker push shipyard/shipyard:$(TAG)
    29  
    30  test: clean 
    31  	@godep go test -v ./...
    32  
    33  .PHONY: all build clean media image test release