Skip to content

Commit

Permalink
add environment variable for rc url (bcgov#31)
Browse files Browse the repository at this point in the history
* add env var for rc url

* update constants
  • Loading branch information
ShellyXueHan authored Feb 12, 2019
1 parent cb3f294 commit 13119bc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ REACT_APP_SSO_REALM_NAME=
REACT_APP_SSO_CLIENT_ID=
REACT_APP_SSO_BASE_URL=
REACT_APP_API_BASE_URL=
REACT_APP_ROCKETCHAT_URL
4 changes: 4 additions & 0 deletions .pipeline/lib/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ module.exports = () => {
oc.options.env === 'prod'
? 'https://reggie-api-prod-devhub-prod.pathfinder.gov.bc.ca'
: 'https://reggie-api-test-devhub-test.pathfinder.gov.bc.ca',
REACT_APP_ROCKETCHAT_URL_VALUE:
oc.options.env === 'prod'
? 'https://chat-pilot.pathfinder.gov.bc.ca/'
: 'https://chat-dev.pathfinder.gov.bc.ca/',
};

const objects = oc.process(oc.toFileUrl(templateFile), {
Expand Down
7 changes: 7 additions & 0 deletions openshift/dc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ objects:
key: SSO_CLIENT_ID
- name: REACT_APP_API_BASE_URL
value: ${REACT_APP_API_BASE_URL_VALUE}
- name: REACT_APP_ROCKETCHAT_URL
value: ${REACT_APP_ROCKETCHAT_URL_VALUE}
volumeMounts:
- name: ${VOLUMN_NAME}
mountPath: /etc/Caddyfile
Expand Down Expand Up @@ -143,6 +145,11 @@ parameters:
name: REACT_APP_API_BASE_URL_VALUE
required: false
value: ''
- description: A url of rc app
displayName: website of rc
name: REACT_APP_ROCKETCHAT_URL_VALUE
required: false
value: ''
- description: A volumn used for the caddy from config map
displayName: volumn name
name: VOLUMN_NAME
Expand Down
3 changes: 2 additions & 1 deletion src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"ssoRealmName": "{{.Env.REACT_APP_SSO_REALM_NAME}}",
"ssoClientId": "{{.Env.REACT_APP_SSO_CLIENT_ID}}",
"ssoBaseUrl": "{{.Env.REACT_APP_SSO_BASE_URL}}",
"apiBaseUrl": "{{.Env.REACT_APP_API_BASE_URL}}"
"apiBaseUrl": "{{.Env.REACT_APP_API_BASE_URL}}",
"rocketchatUrl": "{{.Env.REACT_APP_ROCKETCHAT_URL}}"
}
2 changes: 1 addition & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const SSO_IDP = {

export const SELF_SERVER_APP = {
ROCKETCHAT: {
URL: 'https://chat-pilot.pathfinder.gov.bc.ca/',
URL: process.env.REACT_APP_ROCKETCHAT_URL || config.rocketchatUrl,
NAME: 'rc',
INVITATION_CODE: 'rc',
},
Expand Down

0 comments on commit 13119bc

Please sign in to comment.