Commit 6d4586ce authored by Andrew Hrdy's avatar Andrew Hrdy

Environment variables fixed. Using npm in gitlab-ci.

parent c1e447d0
Pipeline #2486 failed with stage
in 4 minutes and 29 seconds
......@@ -9,9 +9,8 @@ build:
variables:
API_GET_FACILITIES: "https://api.srct.gmu.edu/whatsopen/v2/facilities/"
script:
- npm install -g yarn
- yarn install
- CI=false REACT_APP_API_GET_FACILITIES=$API_GET_FACILITIES npm run build
- npm install
- CI=false API_GET_FACILITIES=$API_GET_FACILITIES npm run build
artifacts:
paths:
- build
......@@ -21,9 +20,8 @@ build_shopmason:
variables:
API_GET_FACILITIES: "https://api.srct.gmu.edu/whatsopen/v2/facilities/?facility_classifier=shopmason"
script:
- npm install -g yarn
- yarn install
- CI=false REACT_APP_API_GET_FACILITIES=$API_GET_FACILITIES npm run build
- npm install
- CI=false API_GET_FACILITIES=$API_GET_FACILITIES npm run build
artifacts:
paths:
- build
......
import {GET_ALERTS, GET_FACILITIES, SET_ALERTS, SET_FACILITIES, SORT_FACILITY_CARDS, VIEW_ALERT} from './action-types';
const API_GET_FACILITIES = process.env.REACT_APP_API_GET_FACILITIES ? process.env.REACT_APP_API_GET_FACILITIES :
const API_GET_FACILITIES = process.env.API_GET_FACILITIES ? process.env.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';
export const getFacilities = () => (dispatch) => {
......
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
......@@ -77,6 +78,9 @@ module.exports = {
new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: '[id].css'
}),
new webpack.DefinePlugin({
'process.env.API_GET_FACILITIES': process.env.API_GET_FACILITIES
})
]
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment