Skip to content

Commit

Permalink
Merge pull request iconicompany#8 from iconicompany/githubenv
Browse files Browse the repository at this point in the history
add Env to build time
  • Loading branch information
slavb18 authored Apr 9, 2024
2 parents cdf01be + dd42d8d commit 012ab11
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion console.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
2 changes: 1 addition & 1 deletion console.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
2 changes: 1 addition & 1 deletion werf.sh
Original file line number Diff line number Diff line change
@@ -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 $*
2 changes: 1 addition & 1 deletion werf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ configVersion: 1
---
image: app
dockerfile: Dockerfile
args: { DATABASE_URL: "postgres://[email protected]/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://[email protected]/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/

0 comments on commit 012ab11

Please sign in to comment.