diff --git a/Jenkinsfile b/Jenkinsfile index f36238f7ddef962f61055da167e15b89b323cc54..40f9cb5d779f9be8144e11d4aad4dcecbc141cf9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -75,10 +75,8 @@ tools { go 'go-1.22.0' } chmod +x ./buf ./buf generate #to compile go statically with these tags, so that the binary is not dynamically linked and from scratch in Dockerfile will work - APP_ENV=production go build -tags osusergo,netgo cmd/antragsraum-proxy/main.go - - ''' + ''' } } } diff --git a/config/config-production.yml b/config/config-production.yml index 06bfbdaa6d7c3593a9a569d73c91f2d5a45c2c7e..fbfedf2a51f44e17c007361217a5e2f216d7ed91 100755 --- a/config/config-production.yml +++ b/config/config-production.yml @@ -1,6 +1,6 @@ http: server: - port: 8082 + port: 8083 grpc: server: mock: false diff --git a/internal/config/config.go b/internal/config/config.go index 49ecde635eff2a6dc4358c0f3235c5d84ba8b2c4..8eb97bb8c6991254cf0f7f3cc091833eda564d73 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -66,6 +66,7 @@ func LoadConfig(configFilePath ...string) Config { if env == "" { env = defaultEnv } + fmt.Printf("APP_ENV: %v\n", env) fp := fmt.Sprintf("config/config-%s.yml", env) diff --git a/src/main/helm/templates/deployment.yaml b/src/main/helm/templates/deployment.yaml index 0020d63a9e903c48490745587aade82f31b9953c..b4a6d8c9ad6914f941c71fde3d90f6fe7e54e05c 100644 --- a/src/main/helm/templates/deployment.yaml +++ b/src/main/helm/templates/deployment.yaml @@ -59,7 +59,9 @@ spec: containers: - env: - name: GRPC_SERVER_PORT - value: "{{ .Values.grpc.server.port }}" + value: "{{ ((.Values.grpc).server).port }}" + - name: APP_ENV + value: "production" {{- with include "app.getCustomList" . }} {{ . | indent 10 }} {{- end }} diff --git a/src/main/helm/values.yaml b/src/main/helm/values.yaml index 401690dc5086f2d556e4b43abf091c5fb558e7fe..759391bd2246f5aa2c63036c8a00137c42e5bc44 100644 --- a/src/main/helm/values.yaml +++ b/src/main/helm/values.yaml @@ -31,8 +31,6 @@ image: name: antragraum-proxy tag: latest # [default: latest] - - grpc: server: - mock: false \ No newline at end of file + port: 9090 \ No newline at end of file diff --git a/src/test/helm/deployment_env_test.yaml b/src/test/helm/deployment_env_test.yaml index b5313805d67f3b0f610cbffe9c9c91bbce313a0d..885ca83bf6fe90bbe4d5a6617dc4a08db6ff8c53 100644 --- a/src/test/helm/deployment_env_test.yaml +++ b/src/test/helm/deployment_env_test.yaml @@ -69,15 +69,20 @@ tests: path: spec.template.spec.containers[0].env content: name: GRPC_SERVER_PORT - value: "" + value: "9090" + - contains: + path: spec.template.spec.containers[0].env + content: + name: APP_ENV + value: "production" - it: check set envs set: grpc: server: - port: 9090 + port: 9091 asserts: - contains: path: spec.template.spec.containers[0].env content: name: GRPC_SERVER_PORT - value: "9090" \ No newline at end of file + value: "9091" \ No newline at end of file