1
0
mirror of https://github.com/directorz/mailfull-go.git synced 2025-12-24 04:57:03 +00:00

Merge pull request #23 from directorz/feature/build

Feature/build
This commit is contained in:
teru
2017-07-25 11:03:49 +09:00
committed by GitHub
5 changed files with 72 additions and 40 deletions

48
Gopkg.lock generated Normal file
View File

@@ -0,0 +1,48 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/BurntSushi/toml"
packages = ["."]
revision = "99064174e013895bbd9b025c31100bd1d9b590ca"
version = "v0.3.0"
[[projects]]
branch = "master"
name = "github.com/armon/go-radix"
packages = ["."]
revision = "4239b77079c7b5d1243b7b4736304ce8ddb6f0f2"
[[projects]]
name = "github.com/bgentry/speakeasy"
packages = ["."]
revision = "a1ccbf2c40dfc8ce514b5c5c6e6d1429ea6880da"
[[projects]]
branch = "master"
name = "github.com/jsimonetti/pwscheme"
packages = ["ssha"]
revision = "76804708ecad54773871b35dbaa44f517973e395"
[[projects]]
name = "github.com/mattn/go-isatty"
packages = ["."]
revision = "66b8e73f3f5cda9f96b69efd03dd3d7fc4a5cdb8"
[[projects]]
branch = "master"
name = "github.com/mitchellh/cli"
packages = ["."]
revision = "fcf521421aa29bde1d93b6920dfce826d7932208"
[[projects]]
name = "golang.org/x/sys"
packages = ["unix"]
revision = "8f0908ab3b2457e2e15403d3697c9ef5cb4b57a9"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "d88d2668ae10b500606e3ebb1e719897e62e423f5ede8e4b470d12c1d255fe31"
solver-name = "gps-cdcl"
solver-version = 1

0
Gopkg.toml Normal file
View File

View File

@@ -1,29 +1,42 @@
GOVERSION=$(shell go version)
GOOS=$(word 1,$(subst /, ,$(lastword $(GOVERSION))))
GOARCH=$(word 2,$(subst /, ,$(lastword $(GOVERSION))))
THIS_GOOS=$(word 1,$(subst /, ,$(lastword $(GOVERSION))))
THIS_GOARCH=$(word 2,$(subst /, ,$(lastword $(GOVERSION))))
GOOS?=$(THIS_GOOS)
GOARCH?=$(THIS_GOARCH)
DIR_PKG=$(subst /src/github.com/directorz/mailfull-go,/pkg,$(PWD))
DIR_BUILD=build
DIR_RELEASE=release
VERSION=$(patsubst "%",%,$(lastword $(shell grep 'const Version' version.go)))
GITTAG=$(shell git rev-parse --short HEAD)
.PHONY: build build-linux-amd64 build-linux-386 clean
default: build
installdeps:
glide install -v
$(DIR_BUILD)/bin/$(THIS_GOOS)_$(THIS_GOARCH)/dep:
mkdir -p /tmp/go
GOPATH=/tmp/go go get -d -v github.com/golang/dep
GOPATH=/tmp/go go build -v -o $(DIR_BUILD)/bin/$(THIS_GOOS)_$(THIS_GOARCH)/dep github.com/golang/dep/cmd/dep
rm -rf /tmp/go
dep: $(DIR_BUILD)/bin/$(THIS_GOOS)_$(THIS_GOARCH)/dep
installdeps: dep
$(DIR_BUILD)/bin/$(THIS_GOOS)_$(THIS_GOARCH)/dep ensure -v
build:
go build -v -ldflags "-X main.gittag=`git rev-parse --short HEAD`" -o build/mailfull_$(GOOS)_$(GOARCH)/mailfull cmd/mailfull/mailfull.go
go build -v -i -ldflags "-X main.gittag=$(GITTAG)" -o $(DIR_BUILD)/mailfull_$(GOOS)_$(GOARCH)/mailfull cmd/mailfull/*.go
.build-docker:
docker run --rm -v $(DIR_PKG):/go/pkg -v $(PWD):/go/src/github.com/directorz/mailfull-go -w /go/src/github.com/directorz/mailfull-go \
-e GOOS=$(GOOS) -e GOARCH=$(GOARCH) golang:1.8.3 \
go build -v -i -ldflags "-X main.gittag=$(GITTAG)" -o $(DIR_BUILD)/mailfull_$(GOOS)_$(GOARCH)/mailfull cmd/mailfull/*.go
build-linux-amd64:
docker run --rm -v $(PWD):/go/src/github.com/directorz/mailfull-go -w /go/src/github.com/directorz/mailfull-go \
-e GOOS=linux -e GOARCH=amd64 golang:1.7.4 \
go build -v -ldflags "-X main.gittag=`git rev-parse --short HEAD`" -o "build/mailfull_linux_amd64/mailfull" cmd/mailfull/mailfull.go
@$(MAKE) .build-docker GOOS=linux GOARCH=amd64
build-linux-386:
docker run --rm -v $(PWD):/go/src/github.com/directorz/mailfull-go -w /go/src/github.com/directorz/mailfull-go \
-e GOOS=linux -e GOARCH=386 golang:1.7.4 \
go build -v -ldflags "-X main.gittag=`git rev-parse --short HEAD`" -o "build/mailfull_linux_386/mailfull" cmd/mailfull/mailfull.go
@$(MAKE) .build-docker GOOS=linux GOARCH=386
release: release-linux-amd64 release-linux-386

22
glide.lock generated
View File

@@ -1,22 +0,0 @@
hash: 451657f03f297af9163863497cf6c2f60abfe12d88a282f5aab6deb865d91119
updated: 2016-09-29T12:05:32.00075722+09:00
imports:
- name: github.com/armon/go-radix
version: 4239b77079c7b5d1243b7b4736304ce8ddb6f0f2
- name: github.com/bgentry/speakeasy
version: a1ccbf2c40dfc8ce514b5c5c6e6d1429ea6880da
- name: github.com/BurntSushi/toml
version: 99064174e013895bbd9b025c31100bd1d9b590ca
- name: github.com/jsimonetti/pwscheme
version: 76804708ecad54773871b35dbaa44f517973e395
subpackages:
- ssha
- name: github.com/mattn/go-isatty
version: 66b8e73f3f5cda9f96b69efd03dd3d7fc4a5cdb8
- name: github.com/mitchellh/cli
version: fcf521421aa29bde1d93b6920dfce826d7932208
- name: golang.org/x/sys
version: 8f0908ab3b2457e2e15403d3697c9ef5cb4b57a9
subpackages:
- unix
testImports: []

View File

@@ -1,7 +0,0 @@
package: github.com/directorz/mailfull-go
import:
- package: github.com/BurntSushi/toml
- package: github.com/jsimonetti/pwscheme
subpackages:
- ssha
- package: github.com/mitchellh/cli