diff --git a/.helm/templates/deployment.yaml b/.helm/templates/deployment.yaml index 37ea44e..11f82c2 100644 --- a/.helm/templates/deployment.yaml +++ b/.helm/templates/deployment.yaml @@ -32,8 +32,8 @@ spec: value: {{ $.Values.werf.env }} - name: WERF_NAME value: {{ $.Values.werf.name }} - - name: DATABASE_USER - value: {{ $.Values.werf.name }}_{{ $.Values.werf.env }} + - name: DATABASE_URL + value: "postgres://{{ $.Values.werf.name }}{{ $.Values.werf.env }}@postgresql01.kube01.icncd.ru/{{ $.Values.werf.name }}?schema={{ $.Values.werf.name }}{{ $.Values.werf.env }}&sslmode=require&sslrootcert=/var/run/autocert.step.sm/root.crt&sslcert=/var/run/autocert.step.sm/site.crt&sslkey=/var/run/autocert.step.sm/site.key" {{- range $name, $value := .Values.env }} - name: {{ $name }} value: {{ $value | quote }} diff --git a/console.js b/console.js index fa2c0d9..bdb1939 100644 --- a/console.js +++ b/console.js @@ -17,7 +17,7 @@ console.log(config); async function postgres_now() { const client = new Client(config); await client.connect(); - const res = await client.query("SELECT NOW()"); + const res = await client.query("select current_schema"); await client.end(); return res.rows[0]; } diff --git a/console.sh b/console.sh index 2c2a240..54a42d8 100755 --- a/console.sh +++ b/console.sh @@ -1,2 +1,2 @@ -export DATABASE_URL="postgres://postgresql01.kube01.icncd.ru/imarketplace?sslmode=require&sslrootcert=$HOME/.step/certs/root_ca.crt&sslcert=$HOME/.step/certs/my.crt&sslkey=$HOME/.step/certs/my.key" +export DATABASE_URL="postgres://postgresql01.kube01.icncd.ru/iconicactions?sslmode=require&sslrootcert=$HOME/.step/certs/root_ca.crt&sslcert=$HOME/.step/certs/my.crt&sslkey=$HOME/.step/certs/my.key" bun console.js \ No newline at end of file diff --git a/index.js b/index.js index 37f4928..b106d1d 100644 --- a/index.js +++ b/index.js @@ -20,7 +20,7 @@ const config = { async function postgres_now() { const client = new Client(config); await client.connect(); - const res = await client.query("SELECT NOW()"); + const res = await client.query("select current_schema"); await client.end(); return res.rows[0]; } diff --git a/werf.sh b/werf.sh index 65ef661..9a2395c 100755 --- a/werf.sh +++ b/werf.sh @@ -1,5 +1,5 @@ DOCKER_BUILDKIT=true \ WERF_ENV=testing \ -WERF_SET_DOMAIN=env.DOMAIN=main.iconicompany.icncd.ru \ +WERF_SET_DOMAIN=env.DOMAIN=iconicactions-main.iconicompany.icncd.ru \ WERF_REPO=ghcr.io/iconicompany/iconicactions/iconicactions \ werf $* diff --git a/werf.yaml b/werf.yaml index bdf3205..a404f54 100644 --- a/werf.yaml +++ b/werf.yaml @@ -4,6 +4,6 @@ configVersion: 1 --- image: app dockerfile: Dockerfile -args: { DATABASE_URL: "postgres://github@postgresql01.kube01.icncd.ru/imarketplace?sslmode=require&sslrootcert=/root/.step/certs/root_ca.crt&sslcert=/root/.step/certs/my.crt&sslkey=/root/.step/certs/my.key" } +args: { DATABASE_URL: "postgres://github@postgresql01.kube01.icncd.ru/iconicactions?schema=iconicactions{{ .Env }}&sslmode=require&sslrootcert=/root/.step/certs/root_ca.crt&sslcert=/root/.step/certs/my.crt&sslkey=/root/.step/certs/my.key" } contextAddFiles: - .step/ \ No newline at end of file