From c722b6568714ab2a95c7940bc627e00a7a7786e1 Mon Sep 17 00:00:00 2001 From: Alejandro Falkowski Date: Sat, 18 May 2024 08:29:13 +0200 Subject: [PATCH] feat(config): add ability to verify (#362) --- config/.hadolint.yaml | 1 + config/Dockerfile | 12 ++++++++++++ config/Makefile | 8 ++++++++ config/konfig.yaml | 41 --------------------------------------- config/migrieren.yml | 45 ------------------------------------------- scripts/lib.sh | 2 +- 6 files changed, 22 insertions(+), 87 deletions(-) create mode 100644 config/.hadolint.yaml create mode 100644 config/Dockerfile create mode 100644 config/Makefile delete mode 100644 config/konfig.yaml delete mode 100644 config/migrieren.yml diff --git a/config/.hadolint.yaml b/config/.hadolint.yaml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/config/.hadolint.yaml @@ -0,0 +1 @@ + diff --git a/config/Dockerfile b/config/Dockerfile new file mode 100644 index 0000000..af927af --- /dev/null +++ b/config/Dockerfile @@ -0,0 +1,12 @@ +FROM cimg/go:1.22.3 + +USER root +WORKDIR /usr/local/bin + +# Install yq. +RUN curl -sSOL https://github.com/mikefarah/yq/releases/download/v4.44.1/yq_linux_amd64 && \ + mv yq_linux_amd64 yq && \ + chmod +x yq + +USER circleci +WORKDIR /home/circleci/ diff --git a/config/Makefile b/config/Makefile new file mode 100644 index 0000000..1c1ce55 --- /dev/null +++ b/config/Makefile @@ -0,0 +1,8 @@ +build-docker: + docker build -t alexfalkowski/config:1.0 . + +push-docker: build-docker + docker push alexfalkowski/config:1.0 + +lint-docker: + hadolint Dockerfile diff --git a/config/konfig.yaml b/config/konfig.yaml deleted file mode 100644 index a276935..0000000 --- a/config/konfig.yaml +++ /dev/null @@ -1,41 +0,0 @@ -client: - v1: - host: localhost:12000 - user_agent: "Konfig-client/1.0 gRPC/1.0" - retry: - timeout: 10s - attempts: 3 -debug: - port: 6060 -environment: development -health: - duration: 1s - timeout: 1s -source: - kind: git - git: - url: https://github.com/alexfalkowski/app-config - dir: tmp/app-config -telemetry: - logger: - enabled: true - level: info - tracer: - enabled: true - host: localhost:4318 - secure: false -transport: - http: - enabled: true - port: 11000 - user_agent: "Konfig-server/1.0 HTTP/1.0" - retry: - timeout: 10s - attempts: 3 - grpc: - enabled: true - port: 12000 - user_agent: "Konfig-server/1.0 gRPC/1.0" - retry: - timeout: 10s - attempts: 3 diff --git a/config/migrieren.yml b/config/migrieren.yml deleted file mode 100644 index 89a309f..0000000 --- a/config/migrieren.yml +++ /dev/null @@ -1,45 +0,0 @@ -environment: development -debug: - port: 6060 -client: - v1: - host: localhost:12000 - user_agent: "Migrieren-client/1.0 gRPC/1.0" - timeout: 1s - retry: - timeout: 2s - attempts: 3 - database: postgres - version: 1 -health: - duration: 1s - timeout: 1s -migrate: - databases: - - - name: postgres - source: file://test/migrations - url: pgx5://test:test@localhost:5432/test?sslmode=disable -telemetry: - logger: - enabled: true - level: info - tracer: - enabled: true - host: localhost:4318 - secure: false -transport: - http: - enabled: true - port: 11000 - user_agent: "Migrieren-server/1.0 HTTP/1.0" - retry: - timeout: 2s - attempts: 3 - grpc: - enabled: true - port: 12000 - user_agent: "Migrieren-server/1.0 gRPC/1.0" - retry: - timeout: 2s - attempts: 3 diff --git a/scripts/lib.sh b/scripts/lib.sh index a7003a8..5f678c8 100644 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -13,7 +13,7 @@ changed() { } perform() { - dirs=$(find . -mindepth 1 -maxdepth 1 -type d -not -name scripts -not -name bin -not -name config -not -name grafana -not -name prometheus -not -name vault -not -path '*/\.*' | xargs -n 1 basename) + dirs=$(find . -mindepth 1 -maxdepth 1 -type d -not -name scripts -not -name bin -not -name grafana -not -name prometheus -not -name vault -not -path '*/\.*' | xargs -n 1 basename) for dir in $dirs do