Skip to content

Commit

Permalink
Add deployment scripts without krew index.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjbae1212 committed Jan 31, 2021
1 parent 14c3a62 commit a625fe2
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 2 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: release
on:
push:
tags:
- 'v*.*.*'
jobs:
job_build:
name: goreleaser and build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.15
- name: check gopath
run: |
export GOPATH=$(go env GOPATH)
echo $GOPATH
- name: GoReleaser
uses: goreleaser/goreleaser-action@v2.4.1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.SECRET }}
GOPATH: /home/runner/go
# - name: Update new version in krew-index
# uses: rajatjindal/krew-release-bot@v0.0.38
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
local_env.sh
kubectl-cred
dist
53 changes: 53 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
env:
- GO111MODULE=on
before:
hooks:
- go mod download
builds:
- binary: kubectl-cred
env:
- CGO_ENABLED=0
goos:
- windows
- darwin
- linux
goarch:
- amd64
asmflags:
- all=-trimpath={{.Env.GOPATH}}
gcflags:
- all=-trimpath={{.Env.GOPATH}}
ldflags:
- -s -w
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
amd64: x86_64
format: tar.gz
name_template: "{{ .ProjectName }}_{{ .Tag }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
files:
- LICENSE
- README.md
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
release:
github:
owner: gjbae1212
name: kubectl-cred
brews:
- name: kubectl-cred
tap:
owner: gjbae1212
name: homebrew-kubectl-cred
commit_author:
name: gjbae1212
email: gjbae1212@gmail.com
description: "kubectl-cred is a kubernetes plugin to which switch to contexts using an interactive CLI."
44 changes: 44 additions & 0 deletions .krew.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: cred
spec:
version: {{ .TagName }}
homepage: https://github.com/gjbae1212/kubectl-cred
shortDescription: kubectl-cred is a kubernetes plugin to which switch to contexts and namespaces and clusters using an interactive CLI.
description: |
kubectl-cred is a kubernetes plugin to which switch to contexts and namespaces and clusters using an interactive CLI.
# Switch context using an interactive CLI.
kubectl cred ctx
# Switch namespace using an interactive CLI.
kubectl cred ns
# Show your all of contexts information formatted tree.
kubectl cred ls
# Show your current context information.
kubectl cred current
# Rename context name in k8s config, using an interactive CLI.
kubectl cred rename
platforms:
- selector:
matchLabels:
os: darwin
arch: amd64
{{addURIAndSha "https://github.com/gjbae1212/kubectl-cred/releases/download/{{ .TagName }}/kubectl-cred_{{ .TagName }}_Darwin_x86_64.tar.gz" .TagName }}
bin: kubectl-cred
- selector:
matchLabels:
os: linux
arch: amd64
{{addURIAndSha "https://github.com/gjbae1212/kubectl-cred/releases/download/{{ .TagName }}/kubectl-cred_{{ .TagName }}_Linux_x86_64.tar.gz" .TagName }}
bin: kubectl-cred
- selector:
matchLabels:
os: windows
arch: amd64
{{addURIAndSha "https://github.com/gjbae1212/kubectl-cred/releases/download/{{ .TagName }}/kubectl-cred_{{ .TagName }}_Windows_x86_64.tar.gz" .TagName }}
bin: kubectl-cred.exe
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
var (
rootCmd = &cobra.Command{
Use: "kubectl-cred",
Short: color.CyanString(`kubectl-cred is an interactive CLI to be able to switch kubernetes context.`),
Long: color.CyanString(`kubectl-cred is an interactive CLI to be able to switch kubernetes context.`),
Short: color.CyanString(`kubectl-cred is a kubernetes plugin to which switch to contexts and namespaces and clusters using an interactive CLI.`),
Long: color.CyanString(`kubectl-cred is a kubernetes plugin to which switch to contexts and namespaces and clusters using an interactive CLI.`),
Example: `
# Switch context using an interactive CLI.
kubectl cred ctx
Expand Down

0 comments on commit a625fe2

Please sign in to comment.