Skip to content

Commit f508288

Browse files
committed
Upgrade go1.11 module
1 parent 6ee820f commit f508288

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+60
-21041
lines changed

.travis.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: go
22

33
go:
4-
- 1.9
4+
- 1.11
55

66
env:
77
global:
@@ -15,14 +15,11 @@ sudo: required
1515
services:
1616
- docker
1717

18-
before_script:
19-
- go get golang.org/x/tools/cmd/goimports
20-
2118
script:
22-
- make build
19+
- make build-linux
2320

2421
after_success:
25-
- if [ -n "$TRAVIS_TAG" ]; then make release; fi
22+
- if [ -n "$TRAVIS_TAG" ]; then make releases_in_docker; fi
2623

2724
deploy:
2825
provider: releases

Makefile

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ VERSION := 1.3.4
44

55
LDFLAGS := -s -w \
66
-X 'main.BuildVersion=$(VERSION)' \
7-
-X 'main.BuildGitRev=$(shell git rev-list HEAD --count)' \
8-
-X 'main.BuildGitCommit=$(shell git describe --abbrev=0 --always)' \
7+
-X 'main.BuildGitBranch=$(shell git describe --all)' \
8+
-X 'main.BuildGitRev=$(shell git rev-list --count HEAD)' \
9+
-X 'main.BuildGitCommit=$(shell git rev-parse HEAD)' \
910
-X 'main.BuildDate=$(shell date -u -R)'
1011

1112
default:
@@ -14,13 +15,7 @@ default:
1415
clean:
1516
@ rm -rf $(NAME) ./_releases ./_build
1617

17-
glide-vc:
18-
@ glide update
19-
@ glide-vc --only-code --no-tests --no-legal-files
20-
2118
fmt:
22-
# find . -type f -name '*.go' -not -path "./vendor/*" | xargs goimports -w
23-
@ go list -f "{{range .GoFiles}}{{$$.Dir}}/{{.}} {{end}} {{range .TestGoFiles}}{{$$.Dir}}/{{.}} {{end}}" ./... | xargs goimports -w
2419
@ go fmt ./...
2520

2621
lint:
@@ -29,7 +24,9 @@ lint:
2924
build: \
3025
build-linux \
3126
build-darwin \
32-
build-windows
27+
build-windows \
28+
rpm \
29+
deb
3330

3431
build-linux: clean fmt
3532
@ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags "$(LDFLAGS)" -o _releases/$(NAME)-$(VERSION)-linux-amd64
@@ -87,4 +84,13 @@ sha256sum: build
8784
cd $(CWD)/_releases; sha256sum "$$f" >> $$f.sha256; \
8885
done
8986

90-
release: build sha256sum homebrew docker
87+
releases: build sha256sum homebrew docker
88+
89+
releases_in_docker:
90+
docker run --rm -it \
91+
-v $(CWD):/workspace \
92+
-e GITHUB_TOKEN=$(GITHUB_TOKEN) \
93+
-e DOCKER_PASSWORD=$(DOCKER_PASSWORD) \
94+
--workdir /workspace \
95+
subchen/centos:7-dev \
96+
make releases

glide.lock

Lines changed: 0 additions & 27 deletions
This file was deleted.

glide.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

go.mod

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module github.com/subchen/frep
2+
3+
require (
4+
github.com/BurntSushi/toml v0.3.1
5+
github.com/Masterminds/semver v1.4.2 // indirect
6+
github.com/Masterminds/sprig v2.17.1+incompatible
7+
github.com/aokoli/goutils v1.1.0 // indirect
8+
github.com/go-yaml/yaml v2.1.0+incompatible
9+
github.com/google/uuid v1.1.0 // indirect
10+
github.com/huandu/xstrings v1.2.0 // indirect
11+
github.com/imdario/mergo v0.3.6 // indirect
12+
github.com/subchen/go-cli v2.0.0+incompatible
13+
golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc // indirect
14+
)

go.sum

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
2+
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
3+
github.com/Masterminds/semver v1.4.2 h1:WBLTQ37jOCzSLtXNdoo8bNM8876KhNqOKvrlGITgsTc=
4+
github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
5+
github.com/Masterminds/sprig v2.17.1+incompatible h1:PChbxFGKTWsg9IWh+pSZRCSj3zQkVpL6Hd9uWsFwxtc=
6+
github.com/Masterminds/sprig v2.17.1+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
7+
github.com/aokoli/goutils v1.1.0 h1:jy4ghdcYvs5EIoGssZNslIASX5m+KNMfyyKvRQ0TEVE=
8+
github.com/aokoli/goutils v1.1.0/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ=
9+
github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o=
10+
github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0=
11+
github.com/google/uuid v1.1.0 h1:Jf4mxPC/ziBnoPIdpQdPJ9OeiomAUHLvxmPRSPH9m4s=
12+
github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
13+
github.com/huandu/xstrings v1.2.0 h1:yPeWdRnmynF7p+lLYz0H2tthW9lqhMJrQV/U7yy4wX0=
14+
github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4=
15+
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
16+
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
17+
github.com/subchen/go-cli v2.0.0+incompatible h1:8A2Y13R3ZcE5B7RO5TSKV5KwquwuUKB5jri5gmA9xlI=
18+
github.com/subchen/go-cli v2.0.0+incompatible/go.mod h1:XgWUJcEvZzeSp62+RgNZe61w19G/xIBVuQY9u2qpXmk=
19+
golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc h1:F5tKCVGp+MUAHhKp5MZtGqAlGX3+oCsiL1Q629FL90M=
20+
golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=

main.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
// version
1717
var (
1818
BuildVersion string
19+
BuildGitBranch string
1920
BuildGitRev string
2021
BuildGitCommit string
2122
BuildDate string
@@ -207,11 +208,13 @@ frep nginx.conf.in --load config.json --overwrite
207208
echo "{{ .Env.PATH }}" | frep -
208209
`)
209210

210-
if BuildVersion != "" {
211-
app.Version = BuildVersion + "-" + BuildGitRev
211+
app.Version = BuildVersion
212+
app.BuildInfo = &cli.BuildInfo{
213+
GitBranch: BuildGitBranch,
214+
GitCommit: BuildGitCommit,
215+
GitRevCount: BuildGitRev,
216+
Timestamp: BuildDate,
212217
}
213-
app.BuildGitCommit = BuildGitCommit
214-
app.BuildDate = BuildDate
215218

216219
app.Action = func(c *cli.Context) {
217220
if c.NArg() == 0 {

0 commit comments

Comments
 (0)