Skip to content

Commit

Permalink
fix(ingester): use process.env.HASURA_GRAPHQL_ENDPOINT (#185)
Browse files Browse the repository at this point in the history
* fix(ingester): use process.env.HASURA_GRAPHQL_ENDPOINT

* Update package.json

* Update .env

* Update www-env.configmap.yaml

* Update www-env.configmap.yaml

* Update graphql.js

* Update alert.cronjob.yaml

* Update ingester.cronjob.yaml

* Update package.json
  • Loading branch information
Julien Bouquillon committed Nov 19, 2020
1 parent 740c816 commit 17ba8ea
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion shared/graphql-client/src/index.js
Expand Up @@ -2,7 +2,7 @@ import fetch from "isomorphic-unfetch";
import { createClient } from "@urql/core";

const HASURA_GRAPHQL_ADMIN_SECRET = process.env.HASURA_GRAPHQL_ADMIN_SECRET;
const HASURA_GRAPHQL_ENDPOINT = process.env.GRAPHQL_ENDPOINT;
const HASURA_GRAPHQL_ENDPOINT = process.env.HASURA_GRAPHQL_ENDPOINT;

export const client = createClient({
url: HASURA_GRAPHQL_ENDPOINT,
Expand Down
2 changes: 1 addition & 1 deletion targets/alert-cli/.k8s/alert.cronjob.yaml
Expand Up @@ -30,7 +30,7 @@ spec:
env:
- name: PRODUCTION
value: "${PRODUCTION}"
- name: GRAPHQL_ENDPOINT
- name: HASURA_GRAPHQL_ENDPOINT
value: "http://hasura-cdtn-admin/v1/graphql"
envFrom:
- secretRef:
Expand Down
4 changes: 2 additions & 2 deletions targets/alert-cli/package.json
Expand Up @@ -40,8 +40,8 @@
"build": "ncc build ./src/index.js -o ./dist -e nodegit -s",
"poststart": "sh scripts/clean.sh",
"start": "node --enable-source-maps --unhandled-rejections=strict ./dist/index.js",
"start:dev": "GRAPHQL_ENDPOINT=http://localhost:8080/v1/graphql HASURA_GRAPHQL_ADMIN_SECRET=admin1 node -r esm src/index.js",
"start:dump": "GRAPHQL_ENDPOINT=http://localhost:8080/v1/graphql HASURA_GRAPHQL_ADMIN_SECRET=admin1 DUMP=true node -r esm src/index.js > data/dump.json",
"start:dev": "HASURA_GRAPHQL_ENDPOINT=http://localhost:8080/v1/graphql HASURA_GRAPHQL_ADMIN_SECRET=admin1 node -r esm src/index.js",
"start:dump": "HASURA_GRAPHQL_ENDPOINT=http://localhost:8080/v1/graphql HASURA_GRAPHQL_ADMIN_SECRET=admin1 DUMP=true node -r esm src/index.js > data/dump.json",
"lint": "eslint src/**/*.js",
"types": "tsc",
"test": "jest"
Expand Down
2 changes: 1 addition & 1 deletion targets/frontend/.env
Expand Up @@ -15,5 +15,5 @@ REFRESH_TOKEN_EXPIRES=43200
NEXT_PUBLIC_ACTIVATION_TOKEN_EXPIRES=10080

FRONTEND_URL=http://localhost:3000
GRAPHQL_ENDPOINT=http://localhost:8080/v1/graphql
HASURA_GRAPHQL_ENDPOINT=http://localhost:8080/v1/graphql
PORT=3000
Expand Up @@ -7,7 +7,7 @@ data:
FRONTEND_URL: "https://${HOST}"
FRONTEND_PORT: "${PORT}"
CI_COMMIT_SHORT_SHA: "${CI_COMMIT_SHORT_SHA}"
GRAPHQL_ENDPOINT: "http://hasura-cdtn-admin/v1/graphql"
HASURA_GRAPHQL_ENDPOINT: "http://hasura-cdtn-admin/v1/graphql"
NEXT_PUBLIC_ACTIVATION_TOKEN_EXPIRES: "10080"
NODE_ENV: "production"
REFRESH_TOKEN_EXPIRES: "43200"
Expand Up @@ -7,7 +7,7 @@ data:
FRONTEND_URL: "https://${HOST}"
FRONTEND_PORT: "${PORT}"
CI_COMMIT_SHORT_SHA: "${CI_COMMIT_SHORT_SHA}"
GRAPHQL_ENDPOINT: "http://hasura-cdtn-admin/v1/graphql"
HASURA_GRAPHQL_ENDPOINT: "http://hasura-cdtn-admin/v1/graphql"
NEXT_PUBLIC_ACTIVATION_TOKEN_EXPIRES: "10080"
NODE_ENV: "production"
PRODUCTION: "true"
Expand Down
2 changes: 1 addition & 1 deletion targets/frontend/src/pages/api/graphql.js
Expand Up @@ -20,7 +20,7 @@ const proxy = createProxyMiddleware({
},
pathRewrite: { "^/api/graphql": "/v1/graphql" },
prependPath: false,
target: process.env.GRAPHQL_ENDPOINT,
target: process.env.HASURA_GRAPHQL_ENDPOINT,
ws: true,
xfwd: true, // proxy websockets
});
Expand Down
2 changes: 1 addition & 1 deletion targets/ingester/.k8s/ingester.cronjob.yaml
Expand Up @@ -30,7 +30,7 @@ spec:
env:
- name: PRODUCTION
value: "${PRODUCTION}"
- name: GRAPHQL_ENDPOINT
- name: HASURA_GRAPHQL_ENDPOINT
value: "http://hasura-cdtn-admin/v1/graphql"
envFrom:
- secretRef:
Expand Down
2 changes: 1 addition & 1 deletion targets/ingester/package.json
Expand Up @@ -50,7 +50,7 @@
"scripts": {
"build": "ncc build ./src/cli.js -o ./dist -s",
"cli": "node --enable-source-maps --unhandled-rejections=strict dist/index.js",
"cli:dev": "GRAPHQL_ENDPOINT=http://localhost:8080/v1/graphql HASURA_GRAPHQL_ADMIN_SECRET=admin1 node -r esm src/cli.js",
"cli:dev": "HASURA_GRAPHQL_ENDPOINT=http://localhost:8080/v1/graphql HASURA_GRAPHQL_ADMIN_SECRET=admin1 node -r esm src/cli.js",
"lint": "eslint src/**/*.js",
"types": "tsc",
"test": "jest --passWithNoTests"
Expand Down

0 comments on commit 17ba8ea

Please sign in to comment.