Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open-web
Commits
8d2ac92c
Commit
8d2ac92c
authored
Feb 03, 2018
by
Andrew Hrdy
Browse files
Classifier for API request now uses environment variables. Closes
#16
.
parent
5d4bfb0b
Pipeline
#2093
passed with stages
in 1 minute and 53 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
8d2ac92c
...
...
@@ -10,24 +10,20 @@ build:
API_GET_FACILITIES
:
"
https://api.srct.gmu.edu/whatsopen/v2/facilities/"
script
:
-
npm install -g yarn
-
>
sed "s|^const API_GET_FACILITIES .*|const API_GET_FACILITIES = '$API_GET_FACILITIES';|" -i src/actions/api.js
-
yarn install
-
CI=false npm run build
-
CI=false
REACT_APP_API_GET_FACILITIES=API_GET_FACILITIES
npm run build
artifacts
:
paths
:
-
build
build_shopmason
:
stage
:
build
variables
:
API_GET_FACILITIES
:
"
https://api.srct.gmu.edu/whatsopen/v2/facilities/?facility_classifier=shopmason"
script
:
-
npm install -g yarn
-
>
sed "s|^const API_GET_FACILITIES .*|const API_GET_FACILITIES = '$API_GET_FACILITIES';|" -i src/actions/api.js
-
yarn install
-
CI=false npm run build
-
CI=false
REACT_APP_API_GET_FACILITIES=API_GET_FACILITIES
npm run build
artifacts
:
paths
:
-
build
...
...
src/actions/api.js
View file @
8d2ac92c
import
{
GET_ALERTS
,
GET_FACILITIES
,
SET_ALERTS
,
SET_FACILITIES
,
SORT_FACILITY_CARDS
,
VIEW_ALERT
}
from
'
./action-types
'
;
import
{
GET_ALERTS
,
GET_FACILITIES
,
SET_ALERTS
,
SET_FACILITIES
,
SORT_FACILITY_CARDS
,
VIEW_ALERT
}
from
'
./action-types
'
;
const
API_GET_FACILITIES
=
'
https://api.srct.gmu.edu/whatsopen/v2/facilities/
'
;
const
API_GET_FACILITIES
=
process
.
env
.
REACT_APP_API_GET_FACILITIES
?
process
.
env
.
REACT_APP_API_GET_FACILITIES
:
'
https://api.srct.gmu.edu/whatsopen/v2/facilities/
'
;
const
API_GET_ALERTS
=
'
https://api.srct.gmu.edu/whatsopen/v2/alerts/?ordering=urgency_tag
'
;
// SHOP MASON ONLY
//const API_GET_FACILITIES = 'https://api.srct.gmu.edu/whatsopen/v2/facilities/?facility_classifier=shopmason';
export
const
getFacilities
=
()
=>
(
dispatch
)
=>
{
dispatch
({
type
:
GET_FACILITIES
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment