Skip to content

Commit

Permalink
add build/release instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfenwick committed Jul 28, 2020
1 parent c3e6ca3 commit bf71876
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 11 deletions.
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# node-pod kubectl

A `kubectl` plugin to ...
A `kubectl` plugin to show the assignment of pods to nodes.

## Quick Start

Expand All @@ -9,3 +9,46 @@ kubectl krew install node-pod
kubectl node-pod
```

# How to release

See https://goreleaser.com/quick-start/

Set up a github token and run:

```
VERSION=v9.9.9
git tag $VERSION -m "something about the version"
git push --tags
export GITHUB_TOKEN=...
goreleaser
```

In [the plugin.yaml file](./deploy/krew/plugin.yaml):
- manually update the sha256's using [the checksums file](https://github.com/mattfenwick/krew-node-pod/releases/download/v0.0.3/node-pod_0.0.3_checksums.txt)
- **TODO** is there a better way to do this?
- manually update the versions using [the checksums file](https://github.com/mattfenwick/krew-node-pod/releases/download/v0.0.3/node-pod_0.0.3_checksums.txt)
- **TODO** is there a better way to do this?

# How to test a local release

1. download a binary from [the github project release page](https://github.com/mattfenwick/krew-node-pod/releases/tag/v0.0.3)

2. run a `krew install` against the downloaded binary

```
kubectl krew install --manifest=./deploy/krew/plugin.yaml --archive=/Users/mfenwick/Downloads/node-pod_darwin_amd64.tar.gz
```

3. test it

```
kubectl node-pod
```

4. clean up

```
kubectl krew uninstall node-pod
```
20 changes: 10 additions & 10 deletions deploy/krew/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ kind: Plugin
metadata:
name: node-pod
spec:
version: "v0.1.0"
version: "v0.0.3"
platforms:
- selector:
matchLabels:
os: linux
arch: amd64
uri: https://github.com/mattfenwick/krew-node-pod/releases/download/v0.1.0/node-pod_linux_amd64.tar.gz
sha256: ""
uri: https://github.com/mattfenwick/krew-node-pod/releases/download/v0.0.3/node-pod_linux_amd64.tar.gz
sha256: "d4072e0a9435dbed7075e8cb478741ab7d24e6184cefec6a865d7f782b2d2fc7"
files:
- from: "./node-pod"
to: "."
Expand All @@ -21,8 +21,8 @@ spec:
matchLabels:
os: darwin
arch: amd64
uri: https://github.com/mattfenwick/krew-node-pod/releases/download/v0.1.0/node-pod_darwin_amd64.tar.gz
sha256: ""
uri: https://github.com/mattfenwick/krew-node-pod/releases/download/v0.0.3/node-pod_darwin_amd64.tar.gz
sha256: "42f32d1d029a5c0f898fee27a3049213392caf83fd3be5f93364685388e44295"
files:
- from: "./node-pod"
to: "."
Expand All @@ -33,23 +33,23 @@ spec:
matchLabels:
os: windows
arch: amd64
uri: https://github.com/mattfenwick/krew-node-pod/releases/download/v0.1.0/node-pod_windows_amd64.zip
sha256: ""
uri: https://github.com/mattfenwick/krew-node-pod/releases/download/v0.0.3/node-pod_windows_amd64.zip
sha256: "b85d4e550946a053801bce0c208c1afc47109c0ab6e17d86efd9727d37a942b9"
files:
- from: "/node-pod.exe"
to: "."
- from: LICENSE
to: "."
bin: "node-pod.exe"
shortDescription: A new plugin
shortDescription: Shows assignment of pods to nodes.
homepage: https://github.com/mattfenwick/krew-node-pod
caveats: |
Usage:
$ kubectl node-pod
For additional options:
$ kubectl node-pod --help
or https://github.com/mattfenwick/krew-node-pod/blob/v0.1.0/doc/USAGE.md
or https://github.com/mattfenwick/krew-node-pod/blob/v0.0.3/doc/USAGE.md
description: |
This is a new plugin
This plugin shows the assignment of pods to nodes.
3 changes: 3 additions & 0 deletions pkg/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ func setupRootCmd() *cobra.Command {
SilenceErrors: true,
SilenceUsage: true,
RunE: func(cmd *cobra.Command, as []string) error {
// TODO detect whether this is running under kubectl or not, and modify help message accordingly
// see https://krew.sigs.k8s.io/docs/developer-guide/develop/best-practices/#auth-plugins
// if strings.HasPrefix(filepath.Base(os.Args[0]), "kubectl-") { }
runRootCmd(args)
return nil
},
Expand Down

0 comments on commit bf71876

Please sign in to comment.