Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/react-scripts/scripts/utils/frontierInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ async function promptForConfig() {
name: `Redux (Chances are high you don't need this yet)`,
value: 'redux',
},
{
name: `Configure app for Electric Flow`,
value: 'redux',
},
],
},
];
Expand All @@ -48,6 +52,9 @@ function installFrontierDependencies(appPath, answers, useYarn, ownPath) {
if (additionalFeatures.includes('redux')) {
configureRedux(appPath, useYarn, ownPath);
}
if (additionalFeatures.includes('electic-flow')) {
configureEF(appPath);
}
injectPolymerCode(appPath);

const defaultModules = [
Expand Down Expand Up @@ -144,6 +151,14 @@ function configureRedux(appPath, useYarn, ownPath) {
fs.copySync(templatePath, appPath, { overwrite: true });
}

function configureEF(appPath, useYarn, ownPath) {
// TODO - modify package.json to make sure name is correct for blueprint
// TODO - use blueprint.yml as a template

const templatePath = path.join(ownPath, 'template-ef');
fs.copySync(templatePath, appPath, { overwrite: true });
}

function cleanupFrontierCode(appPath) {}

function installModulesSync(modules, useYarn, saveDev = false) {
Expand Down
1 change: 1 addition & 0 deletions packages/react-scripts/template-ef/.buildpacks
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/heroku/heroku-buildpack-nodejs.git
1 change: 1 addition & 0 deletions packages/react-scripts/template-ef/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: node src/server.js
44 changes: 44 additions & 0 deletions packages/react-scripts/template-ef/blueprint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: 1.0
name: frontier-{{APP_NAME}}

build:
- type: "Npm-Heroku v1_0"
heroku_stack: heroku-18
name: npm-build

deploy:
int:
{{APP_NAME}}: &APP_DEFAULTS
type: "Heroku v1_0"
stack_name: heroku-18
location: development-fh5-useast1-heroku
binding_sets:
{{BINDING_PATH}}:
- type: "Service v1_0"
sites:
- integ
bindings: &BINDING_DEFAULTS
heroku:
type: "Alias v1_0"
aliases:
- www
non_ssl_action:
type: redirect_to_https
append_slash: true
prod:
{{APP_NAME}}:
<<: *APP_DEFAULTS
type: "Heroku v1_0"
stack_name: cedar-14
location: production-fh1-useast1-heroku
binding_sets:
{{BINDING_PATH}}:
- type: "Service v1_0"
sites:
- prod
bindings:
<<: *BINDING_DEFAULTS
deliver:
deploy_order:
- int
- prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Get artifactory token from SAS
ICS_AF_TOKEN=ec-sas-client frontier-hub-ics-public-artifactory-db password
NPMRC_TOKEN="//code.lds.org/artifactory/api/npm/npm-fhd/:_authToken=${ICS_AF_TOKEN}"
NPMRC_ICS_REGISTRY="@fs:registry=https://code.lds.org/artifactory/api/npm/npm-fhd/"

# Write .npmrc
echo $NPMRC_TOKEN > .npmrc
echo $NPMRC_ICS_REGISTRY >> .npmrc
10 changes: 10 additions & 0 deletions packages/react-scripts/template-ef/src/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var express = require("express");
var path = require("path");
var app = express();

// React App
app.use(express.static(__dirname + "/build"));

const port = process.env.PORT || 3000;
app.listen(port);
console.log("Listening on port " + port)