Skip to content

Commit

Permalink
Add cross compile command in Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
c-bata committed Aug 12, 2017
1 parent 6815660 commit 5e1813c
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ kube-prompt

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
pkg/

# glide
vendor/
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,40 @@ LDFLAGS := -X 'main.version=$(VERSION)' \

.DEFAULT_GOAL := help

.PHONY: setup
setup: ## Setup for required tools.
go get github.com/golang/lint/golint
go get golang.org/x/tools/cmd/goimports
go get -u github.com/golang/dep/cmd/dep

.PHONY: fmt
fmt: ## Formatting source codes.
@goimports -w ./kube

.PHONY: lint
lint: ## Run golint and go vet.
@golint ./kube/...
@go vet ./kube/...

.PHONY: test
test: ## Run the tests.
@go test ./kube/...

.PHONY: build
build: main.go ## Build a binary.
go build -ldflags "$(LDFLAGS)"

.PHONY: cross
cross: main.go ## Build binaries for cross platform.
mkdir -p pkg
@for os in "darwin" "linux"; do \
for arc in "amd64" "386"; do \
GOOS=$${os} GOARC=$${arc} make build; \
zip pkg/kube-prompt_$(VERSION)_$${os}_$${arc}.zip kube-prompt; \
done; \
done

.PHONY: help
help: ## Show help text
@echo "Commands:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'

.PHONY: setup fmt lint test help build

39 changes: 34 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,49 @@
# kube-prompt

An interactive kubernetes client featuring auto-complete written in Go.
An interactive kubernetes client featuring auto-complete using [go-prompt](https://github.com/c-bata/go-prompt).

![demo](./_resources/kube-prompt.gif)

kube-prompt's command is same with kubectl (because basically this is just wrapper).
So it doesn't require the additional cost to learn the usage of kube-prompt.

Binaries are available from github releases:
## Installation

* macOS (darwin)
* Linux
#### Binary installation

Binaries are available from [github release](https://github.com/c-bata/kube-prompt/releases).

```
# macOS (darwin)
curl -L https://github.com/c-bata/kube-prompt/releases/download/v1.0.0/kube-prompt_v0.1.0_darwin_amd64.zip
unzip kube-prompt_v1.0.0_darwin_amd64.zip
# Linux
curl -L https://github.com/c-bata/kube-prompt/releases/download/v1.0.0/kube-prompt_v0.1.0_linux_amd64.zip
unzip kube-prompt_v1.0.0_linux_amd64.zip
# After that please put executable to your PATH:
chmod +x kube-prompt
sudo mv ./kube-prompt /usr/local/bin/kube-prompt
```

#### Build from source

```console
$ go get -u github.com/golang/dep/cmd/dep
$ dep ensure # download dependency package
$ go build .
```

To create a multi-platform binary, use the cross command via make:

```console
$ make cross
```

## Goal

Hopefully support following commands and resource types enough to operate kubernetes as kubectl.
Hopefully support following commands enough to operate kubernetes.

* [x] `get` Display one or many resources
* [x] `describe` Show details of a specific resource or group of resources
Expand Down

0 comments on commit 5e1813c

Please sign in to comment.