From 11933fd2a0f7ede94b5eb9c5a7fc9594fa090cf5 Mon Sep 17 00:00:00 2001 From: Rajat Jindal Date: Mon, 3 Feb 2020 22:02:21 +0530 Subject: [PATCH] add another deploy element to publish krew-index --- .krew.yaml | 51 ++++++++++++++++++++++++++++++++++++ .travis.yml | 6 +++++ scripts/update-krew-index.sh | 7 +++++ 3 files changed, 64 insertions(+) create mode 100644 .krew.yaml create mode 100644 scripts/update-krew-index.sh diff --git a/.krew.yaml b/.krew.yaml new file mode 100644 index 0000000..dc1269b --- /dev/null +++ b/.krew.yaml @@ -0,0 +1,51 @@ +apiVersion: krew.googlecontainertools.github.com/v1alpha2 +kind: Plugin +metadata: + name: sniff +spec: + version: {{ .TagName }} + homepage: https://github.com/eldadru/ksniff + platforms: + - {{ addURIAndSha "https://github.com/eldadru/ksniff/releases/download/{{ .TagName }}/ksniff.zip" .TagName }} + bin: kubectl-sniff + files: + - from: ./kubectl-sniff-darwin + to: kubectl-sniff + - from: ./static-tcpdump + to: static-tcpdump + selector: + matchLabels: + os: darwin + arch: amd64 + - {{ addURIAndSha "https://github.com/eldadru/ksniff/releases/download/{{ .TagName }}/ksniff.zip" .TagName }} + bin: kubectl-sniff + files: + - from: ./kubectl-sniff + to: kubectl-sniff + - from: ./static-tcpdump + to: static-tcpdump + selector: + matchLabels: + os: linux + arch: amd64 + - {{ addURIAndSha "https://github.com/eldadru/ksniff/releases/download/{{ .TagName }}/ksniff.zip" .TagName }} + bin: kubectl-sniff.exe + files: + - from: ./kubectl-sniff-windows + to: kubectl-sniff.exe + - from: ./static-tcpdump + to: static-tcpdump + selector: + matchLabels: + os: windows + arch: amd64 + shortDescription: Start a remote packet capture on pods using tcpdump and wireshark + caveats: | + This plugin needs the following programs: + * wireshark (optional, used for live capture) + description: | + When working with micro-services, many times it's very helpful to get a capture of the network + activity between your micro-service and it's dependencies. + + ksniff use kubectl to upload a statically compiled tcpdump binary to your pod and redirecting it's + output to your local Wireshark for smooth network debugging experience. diff --git a/.travis.yml b/.travis.yml index 05301af..f461464 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,3 +26,9 @@ deploy: on: tags: true branch: master + - provider: script + script: + - env GITHUB_TOKEN=${GITHUB_OAUTH_TOKEN} bash scripts/update-krew-index.sh + on: + tags: true + branch: master \ No newline at end of file diff --git a/scripts/update-krew-index.sh b/scripts/update-krew-index.sh new file mode 100644 index 0000000..64cf29b --- /dev/null +++ b/scripts/update-krew-index.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +export KREW_RELEASE_BOT_VERSION=v0.0.36 + +curl -LO https://github.com/rajatjindal/krew-release-bot/releases/download/${KREW_RELEASE_BOT_VERSION}/krew-release-bot_${KREW_RELEASE_BOT_VERSION}_linux_amd64.tar.gz +tar -xvf krew-release-bot_${KREW_RELEASE_BOT_VERSION}_linux_amd64.tar.gz +./krew-release-bot action \ No newline at end of file