Skip to content
Permalink
Browse files

Add AUTOPILOT_API_KEY to the API

Add environment variable to deployment and deploy script. Add test to
check for missing environment variables.
  • Loading branch information...
akuanti authored and kangarang committed Sep 11, 2019
1 parent 9a7e4f7 commit e36637ae66c73a9500c59e80dae2edea90d173ac
Showing with 24 additions and 0 deletions.
  1. +19 −0 api/test/app.test.js
  2. +2 −0 charts/panvala-api/templates/deployment.yaml
  3. +2 −0 charts/panvala-api/values.yaml
  4. +1 −0 scripts/deploy-api.sh
@@ -21,3 +21,22 @@ describe('GET /', () => {
expect(result.status).toEqual(200);
});
});

// Check that required variables are set
describe('environment variables', () => {
const requiredVariables = [
'RPC_ENDPOINT',
'AUTOPILOT_API_KEY',
// TODO: determine if we should check for these
// 'IPFS_HOST',
// 'IPFS_PORT',
// 'PANVALA_ENV',
// 'GATEKEEPER_ADDRESS',
// 'TOKEN_CAPACITOR_ADDRESS',
];

test.each(requiredVariables)('%s', async variable => {
const value = process.env[variable];
expect(value).toBeDefined();
});
});
@@ -32,6 +32,8 @@ spec:
value: {{ .Values.node_env }}
- name: PANVALA_ENV
value: {{ .Values.panvala_env }}
- name: AUTOPILOT_API_KEY
value: {{ .Values.autopilotApiKey }}
# Database values (from config map)
- name: PRODUCTION_HOST
valueFrom:
@@ -13,6 +13,8 @@ ipfsPort: 5001

web3Host: https://rinkeby.infura.io:8545

autopilotApiKey: key

##

replicaCount: 1
@@ -37,6 +37,7 @@ deploy() {
--set image.repository=${REPO} \
--set service.type=LoadBalancer \
--set web3Host="${ETH_HOST}" \
--set autopilotApiKey="${AUTOPILOT_API_KEY}" \
--set nameOverride="${APP}" \
--set fullnameOverride="${APP}" \
"${APP}-${ENVIRONMENT}" \

0 comments on commit e36637a

Please sign in to comment.
You can’t perform that action at this time.