Skip to content

Commit

Permalink
generate completion file after goreleaser build
Browse files Browse the repository at this point in the history
  • Loading branch information
d-rk committed Aug 3, 2020
1 parent ad14ad4 commit 852952d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
8 changes: 3 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ builds:
- darwin
- linux
- windows
hooks:
post: './generate_completion.sh {{ .Target }} {{ .Path }}'

archives:
- id: default
Expand Down Expand Up @@ -49,10 +51,6 @@ snapcrafts:
A Commandline interface for Apache Kafka which provides useful features adapted from kubectl for Kubernetes.
Multiple kafka brokers can be configured in a config file and the active broker is also persisted within the config.
In addition kafkactl supports auto-completion for its commands as well as topic names.
extra_files:
- source: kafkactl-completion.bash
destination: kafkactl-completion.bash
mode: 0755
apps:
kafkactl:
plugs: ["home", "network", "personal-files"]
Expand All @@ -65,7 +63,7 @@ snapcrafts:
- $HOME/.config/kafkactl
brews:
-
github:
tap:
owner: deviceinsight
name: homebrew-packages

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.Scratch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM SCRATCH
FROM scratch
ENV USER docker
ENV BROKERS localhost:9092
COPY kafkactl /
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ release:
git commit -m "releases $(version)"
git tag -a v$(version) -m "release v$(version)"
git push origin
git push origin $(version)
git push origin v$(version)
10 changes: 10 additions & 0 deletions generate_completion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

TARGET=$1
PATH=$2

if [ "linux_amd64" == "$TARGET" ]; then
echo "generating completions... ($PATH)"
echo "" > /tmp/empty.yaml
$PATH completion bash > kafkactl-completion.bash --config-file=/tmp/empty.yaml
fi

0 comments on commit 852952d

Please sign in to comment.