Skip to content

Commit

Permalink
update krew index manifest update added to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
chandanpasunoori committed Jan 6, 2023
1 parent 9910043 commit b98724e
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 61 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: goreleaser
name: release

on:
push:
push:
tags:
- '*'
- "*"

permissions:
contents: write
Expand All @@ -12,29 +12,29 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
-
name: Login to GitHub Container Registry
go-version: 1.19
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Run GoReleaser
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update krew-index
uses: rajatjindal/[email protected]
with:
krew_template_file: .krew/tail.yaml
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: test
on:
push:
tags:
- v*
- "**"
branches:
- main
- master
pull_request:

permissions:
Expand All @@ -18,6 +18,6 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true
go-version-file: go.mod
cache: true
- run: go test -v ./...
54 changes: 12 additions & 42 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,25 @@ builds:
- linux
goarch:
- amd64
- arm
- arm64
goamd64:
- v1
- v2
- v3
env:
- CGO_ENABLED=0
ldflags:
- -s -w
- -X github.com/boz/tail/version.Version={{.Tag}}
- -X github.com/boz/tail/version.Commit={{.ShortCommit}}
- -X github.com/boz/tail/version.Date={{.Date}}
- -X github.com/boz/tail/version.BuiltBy=GoReleaser
- -X github.com/boz/tail/version.OsName={{.Os}}
- -X github.com/boz/tail/version.PlatformName={{.Arch}}

archives:
-
name_template: '{{ .ProjectName }}_{{ .Tag }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'

brews:
- tap:
Expand All @@ -34,47 +45,6 @@ brews:
homepage: "https://github.com/boz/kail"
description: "kubernetes tail - pod log viewer"

krews:
- name: tail
goarm: 6
goamd64: v2
index:
owner: boz
name: krew-index
branch: master
commit_author:
name: boz
email: [email protected]
homepage: "https://github.com/boz/kail"
description: |-
Kail https://github.com/boz/kail - "Just show me the logs"
Stream logs from all matched containers of all matched pods. Match pods by service,
replicaset, deployment, and others. Adjusts to a changing cluster - pods are
added and removed from logging as they fall in or out of the selection.
Documentation:
See https://github.com/boz/kail or
$ kubectl tail --help
Usage:
# match all pods
$ kubectl tail
# match pods in the 'frontend' namespace
$ kubectl tail --ns staging
# match pods belonging to a replicaset named 'workers' in any namespace.
$ kubectl tail --rs workers
# match pods belonging to the replicaset named 'workers' only in the 'staging' namespace
$ kubectl tail --rs staging/workers
# match pods belonging to both the service "frontend" and the deployment "webapp"
$ kubectl tail --svc frontend --deploy webapp
short_description: "Stream logs from multiple pods and containers using simple, dynamic source selection."

checksum:
name_template: "checksums.txt"
snapshot:
Expand Down
82 changes: 82 additions & 0 deletions .krew/tail.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: tail
spec:
version: "{{ .TagName }}"
platforms:
- {{addURIAndSha "https://github.com/boz/kail/releases/download/{{ .TagName }}/kail_{{ .TagName }}_darwin_arm64.tar.gz" .TagName }}
selector:
matchLabels:
os: darwin
arch: arm64
bin: kail
files:
- from: "kail"
to: "."
- from: LICENSE.txt
to: .
- {{addURIAndSha "https://github.com/boz/kail/releases/download/{{ .TagName }}/kail_{{ .TagName }}_darwin_amd64v2.tar.gz" .TagName }}
selector:
matchLabels:
os: darwin
arch: amd64
bin: kail
files:
- from: "kail"
to: "."
- from: LICENSE.txt
to: .
- {{addURIAndSha "https://github.com/boz/kail/releases/download/{{ .TagName }}/kail_{{ .TagName }}_linux_arm64.tar.gz" .TagName }}
selector:
matchLabels:
os: linux
arch: arm64
bin: kail
files:
- from: "kail"
to: "."
- from: LICENSE.txt
to: .
- {{addURIAndSha "https://github.com/boz/kail/releases/download/{{ .TagName }}/kail_{{ .TagName }}_linux_amd64v2.tar.gz" .TagName }}
selector:
matchLabels:
os: linux
arch: amd64
bin: kail
files:
- from: "kail"
to: "."
- from: LICENSE.txt
to: .
homepage: https://github.com/boz/kail
shortDescription: Stream logs from multiple pods and containers using simple, dynamic source selection.
description: |-
Kail https://github.com/boz/kail - "Just show me the logs"
Stream logs from all matched containers of all matched pods. Match pods by service,
replicaset, deployment, and others. Adjusts to a changing cluster - pods are
added and removed from logging as they fall in or out of the selection.
Documentation:
See https://github.com/boz/kail or
$ kubectl tail --help
Usage:
# match all pods
$ kubectl tail
# match pods in the 'frontend' namespace
$ kubectl tail --ns staging
# match pods belonging to a replicaset named 'workers' in any namespace.
$ kubectl tail --rs workers
# match pods belonging to the replicaset named 'workers' only in the 'staging' namespace
$ kubectl tail --rs staging/workers
# match pods belonging to both the service "frontend" and the deployment "webapp"
$ kubectl tail --svc frontend --deploy webapp
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ require (
github.com/rs/zerolog v1.15.0
github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.8.1
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0
gopkg.in/alecthomas/kingpin.v2 v2.2.6
k8s.io/api v0.26.0
k8s.io/apimachinery v0.26.0
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY=
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down

0 comments on commit b98724e

Please sign in to comment.