Skip to content

Commit bff4251

Browse files
committed
Add script to export stage envs for local execution
1 parent 129d34a commit bff4251

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ Grafana dashboard configmaps are stored in the [Dashboards](./dashboards/) direc
130130

131131
### Required ENV variables
132132

133+
**Note:** For local execution, these can exported from vault with `source test/set_stage_env.sh`
134+
133135
* `CAD_OCM_CLIENT_ID`: refers to the OCM client ID used by CAD to initialize the OCM client
134136
* `CAD_OCM_CLIENT_SECRET`: refers to the OCM client secret used by CAD to initialize the OCM client
135137
* `CAD_OCM_URL`: refers to the used OCM url used by CAD to initialize the OCM client
@@ -150,8 +152,10 @@ Grafana dashboard configmaps are stored in the [Dashboards](./dashboards/) direc
150152

151153
### Optional ENV variables
152154

153-
* `BACKPLANE_PROXY`: refers to the proxy CAD uses for the isolated backplane access flow.
155+
- `BACKPLANE_PROXY`: refers to the proxy CAD uses for the isolated backplane access flow.
154156

155157
**Note:** `BACKPLANE_PROXY` is required for local development, as a backplane api is only accessible through the proxy.
156158

159+
- `CAD_EXPERIMENTAL_ENABLED`: enables experimental investigations when set to `true`, see mapping.go
160+
157161
For Red Hat employees, these environment variables can be found in the SRE-P vault.

test/set_stage_env.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
set -e
3+
4+
export VAULT_ADDR="https://vault.devshift.net"
5+
export VAULT_TOKEN="$(vault login -method=oidc -token-only)"
6+
for v in $(vault kv get -format=json osd-sre/configuration-anomaly-detection/aws/osdstaging1 | jq -r ".data.data|to_entries|map(\"\(.key)=\(.value|tostring)\")|.[]"); do export $v; done
7+
for v in $(vault kv get -format=json osd-sre/configuration-anomaly-detection/backplane/stg | jq -r ".data.data|to_entries|map(\"\(.key)=\(.value|tostring)\")|.[]"); do export $v; done
8+
for v in $(vault kv get -format=json osd-sre/configuration-anomaly-detection/ocm/ocm-cad-staging | jq -r ".data.data|to_entries|map(\"\(.key)=\(.value|tostring)\")|.[]"); do export $v; done
9+
for v in $(vault kv get -format=json osd-sre/configuration-anomaly-detection/pd/stg | jq -r ".data.data|to_entries|map(\"\(.key)=\(.value|tostring)\")|.[]"); do export $v; done
10+
unset VAULT_ADDR VAULT_TOKEN
11+
12+
export CAD_EXPERIMENTAL_ENABLED=true
13+
export BACKPLANE_PROXY=http://squid.corp.redhat.com:3128
14+
15+
echo
16+

0 commit comments

Comments
 (0)