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

Environment variables fixed. Using npm in gitlab-ci.

parent c1e447d0
...@@ -9,9 +9,8 @@ build: ...@@ -9,9 +9,8 @@ build:
variables: variables:
API_GET_FACILITIES: "https://api.srct.gmu.edu/whatsopen/v2/facilities/" API_GET_FACILITIES: "https://api.srct.gmu.edu/whatsopen/v2/facilities/"
script: script:
- npm install -g yarn - npm install
- yarn install - CI=false API_GET_FACILITIES=$API_GET_FACILITIES npm run build
- CI=false REACT_APP_API_GET_FACILITIES=$API_GET_FACILITIES npm run build
artifacts: artifacts:
paths: paths:
- build - build
...@@ -21,9 +20,8 @@ build_shopmason: ...@@ -21,9 +20,8 @@ build_shopmason:
variables: variables:
API_GET_FACILITIES: "https://api.srct.gmu.edu/whatsopen/v2/facilities/?facility_classifier=shopmason" API_GET_FACILITIES: "https://api.srct.gmu.edu/whatsopen/v2/facilities/?facility_classifier=shopmason"
script: script:
- npm install -g yarn - npm install
- yarn install - CI=false API_GET_FACILITIES=$API_GET_FACILITIES npm run build
- CI=false REACT_APP_API_GET_FACILITIES=$API_GET_FACILITIES npm run build
artifacts: artifacts:
paths: paths:
- build - build
......
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 = 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/'; 'https://api.srct.gmu.edu/whatsopen/v2/facilities/';
const API_GET_ALERTS = 'https://api.srct.gmu.edu/whatsopen/v2/alerts/?ordering=urgency_tag'; const API_GET_ALERTS = 'https://api.srct.gmu.edu/whatsopen/v2/alerts/?ordering=urgency_tag';
export const getFacilities = () => (dispatch) => { export const getFacilities = () => (dispatch) => {
......
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin'); const SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin'); const CleanWebpackPlugin = require('clean-webpack-plugin');
...@@ -77,6 +78,9 @@ module.exports = { ...@@ -77,6 +78,9 @@ module.exports = {
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
filename: '[name].css', filename: '[name].css',
chunkFilename: '[id].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