Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
validate-golang:
name: Valdiate Golang
uses: stuttgart-things/github-workflow-templates/.github/workflows/call-golang-validation.yaml@feature/add-homerun-task-go #go-1.23.1
uses: stuttgart-things/github-workflow-templates/.github/workflows/call-golang-validation.yaml@main #go-1.23.1
with:
module-name: machineshop
environment-name: k8s
Expand All @@ -21,4 +21,4 @@ jobs:
golang-version: "1.23.4"
accept-linterrors: true
accept-failedtests: true
secrets: inherit #pragma: allowlist secret
secrets: inherit #pragma: allowlist secret
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ Session.vim
app_linux_amd64
app_linux_arm64

build/*
build/*
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ issues:
- main_test.go

exclude-dirs:
- tests
- tests
44 changes: 44 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-merge-conflict
- id: check-symlinks
#- id: check-yaml
- id: detect-private-key
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0 # or specific git tag
hooks:
- id: shellcheck
args:
- "-e"
- "SC1090"
- "-e"
- "SC1091"
- repo: https://github.com/hadolint/hadolint
rev: "v2.12.0"
hooks:
- id: hadolint-docker
args:
- --ignore
- DL4006
- --ignore
- DL3015
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.30.0
hooks:
- id: check-github-workflows

- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
name: Detect secrets
description: Detects high entropy strings that are likely to be passwords.
entry: detect-secrets-hook
language: python
# for backward compatibility
files: .* # all files
35 changes: 26 additions & 9 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ token-precondition: &release
msg: "Error: You are on the 'main' branch. Please switch to a different branch and try again."

tasks:
do:
desc: Select a task to run
cmds:
- |
task=$(yq e '.tasks | keys' Taskfile.yaml | sed 's/^- //' | gum choose)
task ${task}

check:
desc: "Run pre-commit hooks"
cmds:
- pre-commit run -a

helm-push:
desc: Push helm chart
cmds:
Expand Down Expand Up @@ -142,27 +154,32 @@ tasks:

commit:
desc: Commit + push code into branch
deps: [lint, test]
deps:
- check
cmds:
- rm -rf dist/
- git branch --set-upstream-to=origin/{{ .BRANCH }}
- git pull
- git status
- |
git add *
git status
if [[ -n $(git status --porcelain) ]]; then
echo "committing changes"
echo "Review the changes above."
gum confirm "Do you want to commit these changes?" || exit 0

echo "ENTER COMMIT MESSAGE"
COMMIT_MESSAGE=$(echo $(gum choose "feat: {{ .BRANCH }}" "fix: {{ .BRANCH }}" "BREAKING CHANGE: {{ .BRANCH }}" "ENTER CUSTOM COMMIT MESSAGE"))
COMMIT_MESSAGE=$(gum choose "CUSTOM MESSAGE" "feat: {{ .BRANCH }}" "fix: {{ .BRANCH }}" "BREAKING CHANGE: {{ .BRANCH }}")

if [ "$COMMIT_MESSAGE" == "ENTER CUSTOM COMMIT MESSAGE" ]; then
COMMIT_MESSAGE=$(echo $(gum input --placeholder "scope" --value "commit to {{ .BRANCH }}"))
if [ "$COMMIT_MESSAGE" == "CUSTOM MESSAGE" ]; then
CHANGED_FILES=$(git status --short | awk '{print $2}' | tr '\n' ' ')
COMMIT_MESSAGE=$(gum input --placeholder "Commit message" --value "Changed: $CHANGED_FILES")
fi

git commit --allow-empty -a -m "$(echo ${COMMIT_MESSAGE})"
git commit --allow-empty -a -m "$COMMIT_MESSAGE"
else
echo "no changes"
echo "No changes to commit."
fi
git push origin -u {{ .BRANCH }}
- git push origin -u {{ .BRANCH }}

branch:
desc: Create branch from main
Expand Down
26 changes: 12 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
module github.com/stuttgart-things/clusterbook

go 1.23.1
go 1.24.0

require (
github.com/fatih/color v1.18.0
github.com/pterm/pterm v0.12.80
github.com/stretchr/testify v1.10.0
go.hein.dev/go-version v0.1.0
google.golang.org/grpc v1.70.0
google.golang.org/grpc v1.71.0
google.golang.org/protobuf v1.36.5
gopkg.in/yaml.v3 v3.0.1
gopkg.in/yaml.v3 v3.0.1
gopkg.in/yaml.v2 v2.4.0
k8s.io/apimachinery v0.32.2
k8s.io/client-go v0.32.2
)
Expand All @@ -28,7 +27,6 @@ require (
github.com/google/gofuzz v1.2.0 // indirect
github.com/gookit/color v1.5.4 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lithammer/fuzzysearch v1.1.8 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
Expand All @@ -38,23 +36,23 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/net v0.32.0 // indirect
golang.org/x/oauth2 v0.24.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/oauth2 v0.25.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/term v0.29.0 // indirect
golang.org/x/text v0.22.0 // indirect
golang.org/x/time v0.7.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250227231956-55c901821b1e // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

replace google.golang.org/genproto => google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b
Loading
Loading