Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
brianpursley committed Jul 29, 2022
0 parents commit ebd151e
Show file tree
Hide file tree
Showing 27 changed files with 1,945 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Bug Report
about: Report a bug encountered while using this plugin
labels: kind/bug

---

<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!
-->

**What happened**:

**What you expected to happen**:

**How to reproduce it (as minimally and precisely as possible)**:

**Anything else we need to know?**:

**Environment**:
- Plugin version (use `kubectl confirm version` or `kubectl-confirm version`):
- OS (e.g: `cat /etc/os-release`):

11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Enhancement Request
about: Suggest an enhancement to this plugin
labels: kind/feature

---
<!-- Please only use this template for submitting enhancement requests -->

**What would you like to be added**:

**Why is this needed**:
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#### What type of PR is this?

<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
-->

#### What this PR does / why we need it:

#### Which issue(s) this PR fixes:

#### Unit Tests:
Please check the following box to confirm you have added unit tests:
- [ ] I added unit tests that cover any new or changed code
51 changes: 51 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build

on:
workflow_call:
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ^1.18

- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest

- name: Install golint
run: go install golang.org/x/lint/golint@latest

- name: StaticCheck
run: make staticcheck

- name: Lint
run: make lint

- name: Vet
run: make vet

- name: Verify
run: make verify

- name: Test
run: make test

- name: Build
run: make release

- name: Upload Artifacts
uses: actions/upload-artifact@v2
if: github.event_name != 'pull_request'
with:
name: build-output
path: _output/
if-no-files-found: error
27 changes: 27 additions & 0 deletions .github/workflows/prerelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Prerelease

on:
push:
branches:
- "master"

jobs:
build:
name: Build
uses: ./.github/workflows/build.yaml

prerelease:
name: Prerelease
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: build-output

- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: prerelease
prerelease: true
files: "*"
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
build:
name: Build
uses: ./.github/workflows/build.yaml

release:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: build-output

- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
files: "*"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_output/
43 changes: 43 additions & 0 deletions .krew.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: confirm
spec:
version: {{ .TagName }}
homepage: https://github.com/brianpursley/kubectl-confirm
shortDescription: Show information and prompt for confirmation before running a command
description: |
Shows configuration, dry-run (if available), and diff (if available),
and then prompts you to confirm by typing 'yes' before proceeding to
execute the kubectl command.
platforms:
- bin: kubectl-confirm
{{addURIAndSha "https://github.com/brianpursley/kubectl-confirm/releases/download/{{ .TagName }}/kubectl-confirm-{{ .TagName }}-darwin-amd64.tar.gz" .TagName }}
selector:
matchLabels:
os: darwin
arch: amd64
- bin: kubectl-confirm
{{addURIAndSha "https://github.com/brianpursley/kubectl-confirm/releases/download/{{ .TagName }}/kubectl-confirm-{{ .TagName }}-darwin-arm64.tar.gz" .TagName }}
selector:
matchLabels:
os: darwin
arch: arm64
- bin: kubectl-confirm
{{addURIAndSha "https://github.com/brianpursley/kubectl-confirm/releases/download/{{ .TagName }}/kubectl-confirm-{{ .TagName }}-linux-amd64.tar.gz" .TagName }}
selector:
matchLabels:
os: linux
arch: amd64
- bin: kubectl-confirm
{{addURIAndSha "https://github.com/brianpursley/kubectl-confirm/releases/download/{{ .TagName }}/kubectl-confirm-{{ .TagName }}-linux-arm64.tar.gz" .TagName }}
selector:
matchLabels:
os: linux
arch: arm64
- bin: kubectl-confirm.exe
{{addURIAndSha "https://github.com/brianpursley/kubectl-confirm/releases/download/{{ .TagName }}/kubectl-confirm-{{ .TagName }}-windows-amd64.tar.gz" .TagName }}
selector:
matchLabels:
os: windows
arch: amd64
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Contributing

Contributions are welcome in the form of issue creation and/or pull requests.

If you open a pull request, make sure your code follows standard golang conventions and styling rules and that unit tests have been added to cover any new or changed functionality.
Loading

0 comments on commit ebd151e

Please sign in to comment.