Skip to content

Commit 32efe2d

Browse files
author
Justin Fudally
authored
Merge pull request #117 from github/jfudally-gomodules
Add go modules
2 parents ade935f + a5482f0 commit 32efe2d

File tree

599 files changed

+229546
-32240
lines changed

Some content is hidden

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

599 files changed

+229546
-32240
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# http://docs.travis-ci.com/user/languages/go/
22
language: go
33

4-
go: 1.12.x
4+
go: 1.13.x
55

66
os:
77
- linux

Dockerfile.test

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
FROM golang:1.12.1
1+
FROM golang:1.13-stretch
22
LABEL maintainer="[email protected]"
33

4+
RUN useradd -m testuser
5+
46
RUN apt-get update
57
RUN apt-get install -y lsb-release
68
RUN rm -rf /var/lib/apt/lists/*
79

810
COPY . /go/src/github.com/github/freno
911
WORKDIR /go/src/github.com/github/freno
1012

13+
RUN chown -R testuser .
14+
USER testuser
15+
1116
CMD ["script/test"]

go/cmd/freno/main.go renamed to cmd/freno/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import (
66
gohttp "net/http"
77
"strings"
88

9-
"github.com/github/freno/go/config"
10-
"github.com/github/freno/go/group"
11-
"github.com/github/freno/go/http"
12-
"github.com/github/freno/go/throttle"
9+
"github.com/github/freno/pkg/config"
10+
"github.com/github/freno/pkg/group"
11+
"github.com/github/freno/pkg/http"
12+
"github.com/github/freno/pkg/throttle"
1313
"github.com/outbrain/golib/log"
1414
)
1515

go.mod

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module github.com/github/freno
2+
3+
go 1.13
4+
5+
require (
6+
github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878
7+
github.com/boltdb/bolt v1.3.1
8+
github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b
9+
github.com/go-sql-driver/mysql v1.5.0 // indirect
10+
github.com/hashicorp/go-msgpack v0.5.5
11+
github.com/julienschmidt/httprouter v1.3.0
12+
github.com/outbrain/golib v0.0.0-20180830062331-ab954725f502
13+
github.com/patrickmn/go-cache v2.1.0+incompatible
14+
github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563
15+
golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed // indirect
16+
)

go.sum

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
2+
github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 h1:EFSB7Zo9Eg91v7MJPVsifUysc/wPdN+NOnVe6bWbdBM=
3+
github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQhVx52RsWOnlkpikZr01T/yAVN2gn0861vByNg=
4+
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
5+
github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
6+
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
7+
github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b h1:L/QXpzIa3pOvUGt1D1lA5KjYhPBAN/3iWdP7xeFS9F0=
8+
github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA=
9+
github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=
10+
github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=
11+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
12+
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
13+
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
14+
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
15+
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
16+
github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0=
17+
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
18+
github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI=
19+
github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
20+
github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs=
21+
github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM=
22+
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
23+
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
24+
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
25+
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
26+
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
27+
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
28+
github.com/outbrain/golib v0.0.0-20180830062331-ab954725f502 h1:oS2s2j8GP70jE0IDMyA4BO4HgvkNcjHfR40h2fyhc7s=
29+
github.com/outbrain/golib v0.0.0-20180830062331-ab954725f502/go.mod h1:JDhu//MMvcPVPH889Xr7DyamEbTLumgDBALGUyXrz1g=
30+
github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=
31+
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
32+
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
33+
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
34+
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
35+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
36+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
37+
github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM=
38+
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
39+
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
40+
github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
41+
github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563 h1:dY6ETXrvDG7Sa4vE8ZQG4yqWg6UnOcbqTAahkV813vQ=
42+
github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
43+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
44+
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
45+
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
46+
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
47+
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
48+
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
49+
golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed h1:uPxWBzB3+mlnjy9W58qY1j/cjyFjutgw/Vhan2zLy/A=
50+
golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=

vendor/github.com/hashicorp/raft-boltdb/bench_test.go renamed to internal/raft-boltdb/bench_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"os"
55
"testing"
66

7-
"github.com/hashicorp/raft/bench"
7+
"github.com/github/freno/internal/raft/bench"
88
)
99

1010
func BenchmarkBoltStore_FirstIndex(b *testing.B) {

vendor/github.com/hashicorp/raft-boltdb/bolt_store.go renamed to internal/raft-boltdb/bolt_store.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"errors"
55

66
"github.com/boltdb/bolt"
7-
"github.com/hashicorp/raft"
7+
"github.com/github/freno/internal/raft"
88
)
99

1010
const (

vendor/github.com/hashicorp/raft-boltdb/bolt_store_test.go renamed to internal/raft-boltdb/bolt_store_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"testing"
99

1010
"github.com/boltdb/bolt"
11-
"github.com/hashicorp/raft"
11+
"github.com/github/freno/internal/raft"
1212
)
1313

1414
func testBoltStore(t testing.TB) *BoltStore {
File renamed without changes.

vendor/github.com/hashicorp/raft/bench/bench.go renamed to internal/raft/bench/bench.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package raftbench
66
// makes comparing backend performance easier by sharing the tests.
77

88
import (
9-
"github.com/hashicorp/raft"
9+
"github.com/github/freno/internal/raft"
1010
"testing"
1111
)
1212

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

go/group/consensus.go renamed to pkg/group/consensus.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package group
33
import (
44
"time"
55

6-
"github.com/github/freno/go/config"
7-
"github.com/github/freno/go/throttle"
6+
"github.com/github/freno/pkg/config"
7+
"github.com/github/freno/pkg/throttle"
88
"github.com/outbrain/golib/log"
99
metrics "github.com/rcrowley/go-metrics"
1010
)

go/group/consensus_service.go renamed to pkg/group/consensus_service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package group
33
import (
44
"time"
55

6-
"github.com/github/freno/go/base"
6+
"github.com/github/freno/pkg/base"
77
)
88

99
const monitorInterval = 5 * time.Second

go/group/fsm.go renamed to pkg/group/fsm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"io"
66
"time"
77

8-
"github.com/hashicorp/raft"
8+
"github.com/github/freno/internal/raft"
99
"github.com/outbrain/golib/log"
1010
)
1111

go/group/fsm_snapshot.go renamed to pkg/group/fsm_snapshot.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package group
33
import (
44
"encoding/json"
55

6-
"github.com/github/freno/go/base"
6+
"github.com/github/freno/pkg/base"
77

8-
"github.com/hashicorp/raft"
8+
"github.com/github/freno/internal/raft"
99
)
1010

1111
// snapshotData holds whatever data we wish to persist as part of raft snapshotting

go/group/mysql.go renamed to pkg/group/mysql.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ import (
4040
"sync/atomic"
4141
"time"
4242

43-
"github.com/github/freno/go/base"
44-
"github.com/github/freno/go/config"
45-
"github.com/github/freno/go/throttle"
43+
"github.com/github/freno/pkg/base"
44+
"github.com/github/freno/pkg/config"
45+
"github.com/github/freno/pkg/throttle"
4646

4747
"github.com/outbrain/golib/log"
4848
"github.com/outbrain/golib/sqlutils"

go/group/raft.go renamed to pkg/group/raft.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import (
1111
"fmt"
1212
"strings"
1313

14-
"github.com/github/freno/go/config"
15-
"github.com/github/freno/go/throttle"
14+
"github.com/github/freno/pkg/config"
15+
"github.com/github/freno/pkg/throttle"
1616
"github.com/outbrain/golib/log"
1717

18-
"github.com/hashicorp/raft"
18+
"github.com/github/freno/internal/raft"
1919
)
2020

2121
const RaftDBFile = "freno-raft.db"

go/group/raft_test.go renamed to pkg/group/raft_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package group
33
import (
44
"testing"
55

6-
"github.com/github/freno/go/config"
6+
"github.com/github/freno/pkg/config"
77

88
test "github.com/outbrain/golib/tests"
99
)

go/group/store.go renamed to pkg/group/store.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import (
1515
"strings"
1616
"time"
1717

18-
"github.com/github/freno/go/base"
19-
"github.com/github/freno/go/throttle"
18+
"github.com/github/freno/pkg/base"
19+
"github.com/github/freno/pkg/throttle"
2020

21-
"github.com/hashicorp/raft"
22-
"github.com/hashicorp/raft-boltdb"
21+
"github.com/github/freno/internal/raft"
22+
"github.com/github/freno/internal/raft-boltdb"
2323
"github.com/outbrain/golib/log"
2424
metrics "github.com/rcrowley/go-metrics"
2525
)
File renamed without changes.

go/haproxy/parser.go renamed to pkg/haproxy/parser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"strings"
99
"time"
1010

11-
"github.com/github/freno/go/base"
11+
"github.com/github/freno/pkg/base"
1212

1313
"github.com/patrickmn/go-cache"
1414
)
File renamed without changes.
File renamed without changes.

go/http/api.go renamed to pkg/http/api.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99
"strings"
1010
"time"
1111

12-
"github.com/github/freno/go/config"
13-
"github.com/github/freno/go/group"
14-
"github.com/github/freno/go/throttle"
12+
"github.com/github/freno/pkg/config"
13+
"github.com/github/freno/pkg/group"
14+
"github.com/github/freno/pkg/throttle"
1515
metrics "github.com/rcrowley/go-metrics"
1616
"github.com/rcrowley/go-metrics/exp"
1717

go/http/api_test.go renamed to pkg/http/api_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"testing"
99

10-
"github.com/github/freno/go/config"
10+
"github.com/github/freno/pkg/config"
1111
)
1212

1313
func TestLbCheck(t *testing.T) {
File renamed without changes.
File renamed without changes.
File renamed without changes.

go/mysql/mysql_inventory.go renamed to pkg/mysql/mysql_inventory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package mysql
77

88
import (
99
"fmt"
10-
"github.com/github/freno/go/base"
10+
"github.com/github/freno/pkg/base"
1111
)
1212

1313
type ClusterInstanceKey struct {
File renamed without changes.
File renamed without changes.

go/throttle/check.go renamed to pkg/throttle/check.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"fmt"
99

10-
"github.com/github/freno/go/base"
10+
"github.com/github/freno/pkg/base"
1111
metrics "github.com/rcrowley/go-metrics"
1212
)
1313

go/throttle/check_result.go renamed to pkg/throttle/check_result.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package throttle
22

33
import (
4-
"github.com/github/freno/go/base"
4+
"github.com/github/freno/pkg/base"
55
"net/http"
66
)
77

go/throttle/mysql.go renamed to pkg/throttle/mysql.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"net/http"
55
"sort"
66

7-
"github.com/github/freno/go/base"
8-
"github.com/github/freno/go/mysql"
7+
"github.com/github/freno/pkg/base"
8+
"github.com/github/freno/pkg/mysql"
99
)
1010

1111
func aggregateMySQLProbes(

go/throttle/mysql_test.go renamed to pkg/throttle/mysql_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"net/http"
1010
"testing"
1111

12-
"github.com/github/freno/go/base"
13-
"github.com/github/freno/go/mysql"
12+
"github.com/github/freno/pkg/base"
13+
"github.com/github/freno/pkg/mysql"
1414

1515
"github.com/outbrain/golib/log"
1616
test "github.com/outbrain/golib/tests"

go/throttle/throttler.go renamed to pkg/throttle/throttler.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import (
1111
"sync/atomic"
1212
"time"
1313

14-
"github.com/github/freno/go/base"
15-
"github.com/github/freno/go/config"
16-
"github.com/github/freno/go/haproxy"
17-
"github.com/github/freno/go/mysql"
18-
"github.com/github/freno/go/vitess"
14+
"github.com/github/freno/pkg/base"
15+
"github.com/github/freno/pkg/config"
16+
"github.com/github/freno/pkg/haproxy"
17+
"github.com/github/freno/pkg/mysql"
18+
"github.com/github/freno/pkg/vitess"
1919

2020
"github.com/outbrain/golib/log"
2121
"github.com/patrickmn/go-cache"
File renamed without changes.

script/bootstrap

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22

33
set -e
44

5-
# Make sure we have the version of Go we want to depend on, either from the
6-
# system or one we grab ourselves.
7-
# If executing from within Dockerfile then this assumption is inherently true, since we use a `golang` docker image.
8-
. script/ensure-go-installed
5+
readonly supportedGo="go1.1[234]"
96

10-
# Since we want to be able to build this outside of GOPATH, we set it
11-
# up so it points back to us and go is none the wiser
7+
# Ensure go is installed
8+
if ! command -v go ; then
9+
echo "Error: Could not locate go binary!"
10+
exit 1
11+
fi
1212

13-
set -x
14-
rm -rf .gopath
15-
mkdir -p .gopath/src/github.com/github
16-
ln -s "$PWD" .gopath/src/github.com/github/freno
17-
export GOPATH=$PWD/.gopath:$GOPATH
13+
if [[ ! "$(go version)" =~ ${supportedGo} ]] ; then
14+
echo "Error: Unsupported version of go installed!"
15+
exit 1
16+
fi

script/build

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,9 @@ set -e
55
. script/bootstrap
66

77
mkdir -p bin
8-
bindir="$PWD"/bin
9-
scriptdir="$PWD"/script
10-
11-
# We have a few binaries that we want to build, so let's put them into bin/
128

139
version=$(git rev-parse HEAD)
1410
describe=$(git describe --tags --always --dirty)
1511

16-
export GOPATH="$PWD/.gopath"
17-
cd .gopath/src/github.com/github/freno
18-
1912
# We put the binaries directly into the bindir, because we have no need for shim wrappers
20-
go build -o "$bindir/freno" -ldflags "-X main.AppVersion=${version} -X main.BuildDescribe=${describe}" ./go/cmd/freno/main.go
13+
go build -o "bin/freno" -ldflags "-X main.AppVersion=${version} -X main.BuildDescribe=${describe}" ./cmd/freno/main.go

script/build-deploy-tarball

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fi
2121
tarball=$build_dir/${commit_sha}-${build_arch}.tar
2222

2323
# Create the tarball
24-
tar cvf $tarball --mode="ugo=rx" bin/
24+
tar cvf $tarball bin/
2525

2626
# Compress it and copy it to the directory for the CI to upload it
2727
gzip $tarball

0 commit comments

Comments
 (0)