Skip to content

Commit

Permalink
build binary in go1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
the-redback committed Apr 2, 2019
1 parent d8a373a commit cb244fb
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea/
peer-finder
vendor/
17 changes: 17 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true


[[constraint]]
branch = "master"

This comment has been minimized.

Copy link
@tamalsaha

tamalsaha Apr 9, 2019

Contributor

"kubernetes-1.13.0"

name = "k8s.io/apimachinery"

[prune]
go-tests = true
unused-packages = true
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

PKG = kmodules.xyz/peer-finder

all: push

TAG = 0.1
Expand All @@ -31,3 +33,16 @@ push: container

clean:
rm -f peer-finder

build: clean
dep ensure -v
docker run \
--rm \
-u $$(id -u):$$(id -g) \
-v /tmp:/.cache \
-v "$$(pwd):/go/src/$(PKG)" \
-w /go/src/$(PKG) \
-e GOOS=linux \
-e GOARCH=amd64 \
golang:1.10 \
go build
3 changes: 1 addition & 2 deletions peer-finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ func shellOut(sendStdin, script string) {
cmd := exec.Command("bash", "-c", fmt.Sprintf("echo -e '%v' | %v", sendStdin, script))
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
if err != nil {
if err := cmd.Run(); err != nil {
log.Fatalf("Failed to execute %v:, err: %v", script, err)
}
}
Expand Down

1 comment on commit cb244fb

@tamalsaha
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.