Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/release_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish Container

on:
workflow_run:
workflows: ['Lint and Test']
workflows: ['CI']
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo here @ElvenSpellmaker

types:
- completed
branches:
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@

# Go
vendor
bin
dist
.deps/

# generated
bin
plugins/**/bin

# tests
.coverage

# local testers and
local/
.bin
.configmanager
.trivy/fs-sbom-file.json
7 changes: 7 additions & 0 deletions .trivyignore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
vulnerabilities:

secrets:

misconfigurations:

licenses:
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,10 @@

COPY --from=builder /app/bin/configmanager /usr/bin/configmanager

RUN chmod +x /usr/bin/configmanager

Check warning on line 20 in Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Merge this RUN instruction with the consecutive ones.

See more on https://sonarcloud.io/project/issues?id=DevLabFoundry_configmanager&issues=AZzni-KvTuCflqCNQE00&open=AZzni-KvTuCflqCNQE00&pullRequest=58

RUN adduser -D -s /bin/sh -h /home/configmanager configmanager

USER configmanager

ENTRYPOINT ["configmanager"]
15 changes: 15 additions & 0 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: v2
# this ensures we can store the .proto and generated files in the same directory
clean: false
plugins:
- remote: buf.build/protocolbuffers/go
out: plugins/proto
opt:
- paths=source_relative
- remote: buf.build/grpc/go:v1.3.0
out: plugins/proto
opt:
- paths=source_relative
- require_unimplemented_servers=false
inputs:
- directory: plugins/proto
9 changes: 9 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: v2
modules:
- path: ./plugins/proto
lint:
use:
- STANDARD
breaking:
use:
- FILE
2 changes: 1 addition & 1 deletion cmd/configmanager/configmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func cmdutilsInit(rootCmd *Root, cmd *cobra.Command, path string) (*cmdutils.Cmd

cm := configmanager.New(cmd.Context())
cm.Config.WithTokenSeparator(rootCmd.rootFlags.tokenSeparator).WithOutputPath(path).WithKeySeparator(rootCmd.rootFlags.keySeparator).WithEnvSubst(rootCmd.rootFlags.enableEnvSubst)
gnrtr := generator.NewGenerator(cmd.Context(), func(gv *generator.GenVars) {
gnrtr := generator.New(cmd.Context(), func(gv *generator.Generator) {
if rootCmd.rootFlags.verbose {
rootCmd.logger.SetLevel(log.DebugLvl)
}
Expand Down
2 changes: 1 addition & 1 deletion configmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type ConfigManager struct {
func New(ctx context.Context) *ConfigManager {
cm := &ConfigManager{}
cm.Config = config.NewConfig()
cm.generator = generator.NewGenerator(ctx).WithConfig(cm.Config)
cm.generator = generator.New(ctx).WithConfig(cm.Config)
cm.logger = log.New(io.Discard)
return cm
}
Expand Down
88 changes: 85 additions & 3 deletions eirctl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,31 @@ output: prefixed
debug: false

import:
- https://raw.githubusercontent.com/Ensono/eirctl/refs/tags/0.9.3/shared/build/go/eirctl.yaml
- https://raw.githubusercontent.com/Ensono/eirctl/refs/tags/0.9.7/shared/build/go/eirctl.yaml
- https://raw.githubusercontent.com/Ensono/eirctl/refs/tags/0.9.7/shared/security/eirctl.yaml

contexts:
bash:
container:
name: mirror.gcr.io/bash:5.0.18-alpine3.22
buf:
container:
name: docker.io/bufbuild/buf:1.61
pull_timeout: 0
entrypoint: /usr/bin/env

go1xalpine:
container:
name: mirror.gcr.io/golang:1.25-alpine
envfile:
exclude:
- GO
- CXX
- CGO

pipelines:
unit:test:
- pipeline: test:unit
- pipeline: test:unit
env:
ROOT_PKG_NAME: github.com/DevLabFoundry

Expand All @@ -32,6 +47,24 @@ pipelines:
- task: go:build:binary
depends_on: clean

proto:build:
- task: proto:install
- task: proto:generate
depends_on: proto:install

build:plugins:
- task: go:build:plugin
name: awsparamstr
env:
PLUGIN: awsparamstr
- task: go:build:plugin
name: vault
env:
PLUGIN: vault

scan:plugins:
- task: trivy:file:system:sbom

tasks:
show:coverage:
description: Opens the current coverage viewer for the the configmanager utility.
Expand All @@ -47,6 +80,44 @@ tasks:
open http://localhost:6060/pkg/github.com/DevLabFoundry/configmanager/v2/?m=all
godoc -notes "BUG|TODO" -play -http=:6060

go:build:plugin:
context: go1xalpine
command:
- |
mkdir -p .deps
unset GOTOOLCHAIN
ldflags="-s -w -extldflags -static"
GOPATH=/eirctl/.deps GOOS=${BUILD_GOOS} GOARCH=${BUILD_GOARCH} CGO_ENABLED=0 go build -mod=readonly -buildvcs=false -ldflags="$ldflags" \
-o ./plugins/$PLUGIN/bin/$PLUGIN-${BUILD_GOOS}-${BUILD_GOARCH}${BUILD_SUFFIX} ./plugins/$PLUGIN/main.go
echo "---"
echo "Built: $PLUGIN-${BUILD_GOOS}-${BUILD_GOARCH}${BUILD_SUFFIX}"
reset_context: true
variations:
- BUILD_GOOS: darwin
BUILD_GOARCH: amd64
BUILD_SUFFIX: ""
- BUILD_GOOS: darwin
BUILD_GOARCH: arm64
BUILD_SUFFIX: ""
- BUILD_GOOS: linux
BUILD_GOARCH: amd64
BUILD_SUFFIX: ""
- BUILD_GOOS: linux
BUILD_GOARCH: arm64
BUILD_SUFFIX: ""
- BUILD_GOOS: windows
BUILD_GOARCH: amd64
BUILD_SUFFIX: ".exe"
- BUILD_GOOS: windows
BUILD_GOARCH: arm64
BUILD_SUFFIX: ".exe"
- BUILD_GOOS: windows
BUILD_GOARCH: "386"
BUILD_SUFFIX: ".exe"
required:
env:
- PLUGIN

go:build:binary:
context: go1x
description: |
Expand Down Expand Up @@ -93,7 +164,7 @@ tasks:
sonar:coverage:prep:
context: bash
command:
- |
- |
sed -i 's|github.com/DevLabFoundry/configmanager/v2/||g' .coverage/out
echo "Coverage file first 20 lines after conversion:"
head -20 .coverage/out
Expand All @@ -112,4 +183,15 @@ tasks:
- VERSION
- REVISION

# currently unused
proto:install:
context: go1xalpine
command:
- GOPATH=$PWD/local/go go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0

proto:generate:
context: buf
command:
# - PATH=$PATH:$PWD/local/go/bin buf generate
# getting all plugins from the remote registry
- buf generate
Loading
Loading