You've already forked civ
Compare commits
1 Commits
master
...
51bf8cba6b
Author | SHA1 | Date | |
---|---|---|---|
51bf8cba6b
|
@ -1,13 +1,15 @@
|
||||
# Editor configuration, see http://editorconfig.org
|
||||
# EditorConfig is awesome: https://EditorConfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = false
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = false
|
||||
|
||||
[{Makefile,*.go}]
|
||||
indent_style = tab
|
||||
[Makefile]
|
||||
indent_style = tab
|
@ -1,4 +1,4 @@
|
||||
name: "Run Golang tests"
|
||||
name: Golang Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@ -6,34 +6,16 @@ on:
|
||||
push:
|
||||
branches: [ '**' ]
|
||||
tags-ignore: [ '**' ]
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
# integration-test:
|
||||
# name: "Run integration tests"
|
||||
# runs-on: ${{ matrix.os }}
|
||||
# strategy:
|
||||
# matrix:
|
||||
# go: [ stable ]
|
||||
# os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4.3.0
|
||||
# - uses: actions/setup-go@v5.5.0
|
||||
# with:
|
||||
# go-version: ${{ matrix.go }}
|
||||
# - env:
|
||||
# GOPROXY: ${{ vars.GOPROXY }}
|
||||
# run: make test/integration
|
||||
|
||||
unit-test:
|
||||
name: "Run unit tests"
|
||||
unittest:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go: [ stable ]
|
||||
os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v4.3.0
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/setup-go@v5.5.0
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
|
@ -1,4 +1,4 @@
|
||||
name: "Lint Golang files"
|
||||
name: Golang CI lint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@ -6,24 +6,22 @@ on:
|
||||
push:
|
||||
branches: [ '**' ]
|
||||
tags-ignore: [ '**' ]
|
||||
workflow_dispatch: {}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
golangci:
|
||||
name: "Run golang CI linter"
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go: [ stable ]
|
||||
os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v4.3.0
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/setup-go@v5.5.0
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- uses: golangci/golangci-lint-action@v8.0.0
|
||||
with:
|
||||
version: v2.4.0 # renovate: datasource=github-releases depName=golangci/golangci-lint
|
||||
version: v2.1
|
@ -1,4 +1,4 @@
|
||||
name: "Lint Markdown files"
|
||||
name: 'Lint Markdown files'
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@ -6,14 +6,13 @@ on:
|
||||
push:
|
||||
branches: [ '*' ]
|
||||
tags-ignore: [ '*' ]
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
markdown-lint:
|
||||
name: "Run markdown linter"
|
||||
runs-on: ubuntu-latest
|
||||
runs-on:
|
||||
- ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4.3.0
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: DavidAnson/markdownlint-cli2-action@v20.0.0
|
||||
with:
|
||||
globs: '**/*.md'
|
||||
globs: '**/*.md'
|
@ -1,4 +1,4 @@
|
||||
name: "Release"
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -9,15 +9,15 @@ permissions:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: "Release application"
|
||||
runs-on: ubuntu-latest
|
||||
runs-on:
|
||||
- ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4.3.0
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: docker/setup-qemu-action@v3.6.0
|
||||
- uses: actions/setup-go@v5.5.0
|
||||
with:
|
||||
go-version: stable
|
||||
- uses: docker/login-action@v3.5.0
|
||||
- uses: docker/login-action@v3.4.0
|
||||
with:
|
||||
registry: git.cryptic.systems
|
||||
username: ${{ github.repository_owner }}
|
||||
@ -26,9 +26,9 @@ jobs:
|
||||
GITEA_TOKEN: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
|
||||
GONOSUMDB: ${{ vars.GONOSUMDB }}
|
||||
GOPROXY: ${{ vars.GOPROXY }}
|
||||
uses: goreleaser/goreleaser-action@v6.4.0
|
||||
uses: goreleaser/goreleaser-action@v6.3.0
|
||||
with:
|
||||
version: v2.11.2 # renovate: datasource=github-releases depName=goreleaser/goreleaser
|
||||
version: "~> v2"
|
||||
args: release --clean
|
||||
|
||||
sync-to-hub-docker-io:
|
||||
|
@ -8,12 +8,13 @@ on:
|
||||
|
||||
jobs:
|
||||
update-description-on-hub-docker-io:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on:
|
||||
- ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4.3.0
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: peter-evans/dockerhub-description@v4.0.2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_IO_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_IO_PASSWORD }}
|
||||
repository: volkerraschek/civ
|
||||
readme-filepath: README.md
|
||||
readme-filepath: README.md
|
@ -1,13 +0,0 @@
|
||||
version: "2"
|
||||
linters:
|
||||
default: standard
|
||||
enable:
|
||||
- errname
|
||||
- gosec
|
||||
|
||||
exclusions:
|
||||
rules: []
|
||||
warn-unused: true
|
||||
|
||||
run:
|
||||
tests: true
|
4
go.mod
4
go.mod
@ -2,11 +2,11 @@ module git.cryptic.systems/volker.raschek/civ
|
||||
|
||||
go 1.24
|
||||
|
||||
toolchain go1.25.0
|
||||
toolchain go1.24.3
|
||||
|
||||
require (
|
||||
git.cryptic.systems/volker.raschek/dockerutils v0.2.0
|
||||
github.com/Masterminds/semver/v3 v3.4.0
|
||||
github.com/Masterminds/semver/v3 v3.3.1
|
||||
github.com/spf13/cobra v1.9.1
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
)
|
||||
|
4
go.sum
4
go.sum
@ -5,8 +5,8 @@ git.cryptic.systems/volker.raschek/dockerutils v0.2.0/go.mod h1:c4ZZpD2unnzwr7qH
|
||||
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
|
||||
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
|
||||
github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7rj+4nv4=
|
||||
github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
|
||||
github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk=
|
||||
github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=
|
||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||
|
2
main.go
2
main.go
@ -5,5 +5,5 @@ import "git.cryptic.systems/volker.raschek/civ/cmd"
|
||||
var version string
|
||||
|
||||
func main() {
|
||||
_ = cmd.Execute(version)
|
||||
cmd.Execute(version)
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ func (jr *JSONReader) ReadFile() (*domain.Config, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer func() { _ = f.Close() }()
|
||||
defer f.Close()
|
||||
|
||||
return jr.read(f)
|
||||
}
|
||||
@ -79,7 +79,7 @@ func (jw *JSONWriter) WriteFile(config *domain.Config) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() { _ = f.Close() }()
|
||||
defer func() { f.Close() }()
|
||||
return jw.write(f, config)
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ func (yr *YAMLReader) ReadFile() (*domain.Config, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer func() { _ = f.Close() }()
|
||||
defer f.Close()
|
||||
|
||||
return yr.read(f)
|
||||
}
|
||||
@ -129,7 +129,7 @@ func (yw *YAMLWriter) WriteFile(config *domain.Config) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() { _ = f.Close() }()
|
||||
defer func() { f.Close() }()
|
||||
return yw.write(f, config)
|
||||
}
|
||||
|
||||
|
@ -14,8 +14,8 @@ import (
|
||||
// ContainerRuntime is an interface for different container runtimes to return labels
|
||||
// based on their full qualified container image name. For example:
|
||||
//
|
||||
// imageLabels, err := Load(ctx, "docker.io/library/alpine:latest")
|
||||
// imageLabels, err := Load(ctx, "docker.io/library/busybox:latest")
|
||||
// imageLabels, err := Load(ctx, "docker.io/library/alpine:latest")
|
||||
// imageLabels, err := Load(ctx, "docker.io/library/busybox:latest")
|
||||
type ContainerRuntime interface {
|
||||
GetImageLabels(ctx context.Context, name string) (map[string]string, error)
|
||||
}
|
||||
@ -182,7 +182,7 @@ func labelCompareSemver(compareSemver *domain.LabelConstraintCompareSemver, pars
|
||||
}
|
||||
|
||||
func labelCompareString(compareString *domain.LabelConstraintCompareString, labelValue string) bool {
|
||||
var majorState = true
|
||||
var majorState bool = true
|
||||
|
||||
// Equal
|
||||
if compareString.Equal != "" {
|
||||
@ -224,7 +224,7 @@ func labelCompareString(compareString *domain.LabelConstraintCompareString, labe
|
||||
}
|
||||
|
||||
func labelCount(re *regexp.Regexp, labelConstraintCounter *domain.LabelConstraintCounter, labels map[string]string) bool {
|
||||
var majorState = true
|
||||
var majorState bool = true
|
||||
|
||||
var i uint = 0
|
||||
for key := range labels {
|
||||
|
Reference in New Issue
Block a user