-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/multiple deployment #23
Changes from 5 commits
269033b
8907171
95c72f8
b8cd4ca
100467c
dad8074
aa1369c
1e6766c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"projects": { | ||
"default": "env-aware" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#!/bin/bash | ||
multipleBuildsPath="../functions/builds/" | ||
individualBuildAllFiles="build/*" | ||
|
||
craBatteryConsiderateLoading="cra-battery-considerate-loading" | ||
craDeviceClassAwareLoading="cra-device-class-aware-loading" | ||
craMemoryConsiderateLoading="cra-memory-considerate-loading" | ||
craMemoryConsiderateLoadingSketchfab="cra-memory-considerate-loading-sketchfab" | ||
craNetworkAwareCodeSplitting="cra-network-aware-code-splitting" | ||
craNetworkAwareComponent="cra-network-aware-component" | ||
craNetworkAwareDataFetching="cra-network-aware-data-fetching" | ||
craUaAwareCodeSplitting="cra-ua-aware-code-splitting" | ||
reactMovieNetworkAwareComponents="react-movie-network-aware-components" | ||
reactShrineNetworkAwareCodeSplitting="react-shrine-network-aware-code-splitting" | ||
|
||
# cd cra-battery-considerate-loading | ||
cd $craBatteryConsiderateLoading | ||
rm -rf node_modules build | ||
npm install | ||
npm run build | ||
# mkdir -p ../functions/builds/cra-battery-considerate-loading | ||
mkdir -p "${multipleBuildsPath}${craBatteryConsiderateLoading}" | ||
# cp -r build/* ../functions/builds/cra-battery-considerate-loading | ||
cp -r $individualBuildAllFiles "${multipleBuildsPath}${craBatteryConsiderateLoading}" | ||
cd .. | ||
|
||
cd $craDeviceClassAwareLoading | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Am I correct in saying if a build for a particular sub-project fails, we will bail out of building the others? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm afraid I have not tried if we can skip the failure and keep going with the rest of builds. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on what I've tested, we can skip the failure and keep going with the rest of builds. |
||
rm -rf node_modules build | ||
npm install | ||
npm run build | ||
mkdir -p "${multipleBuildsPath}${craDeviceClassAwareLoading}" | ||
cp -r $individualBuildAllFiles "${multipleBuildsPath}${craDeviceClassAwareLoading}" | ||
cd .. | ||
|
||
cd $craMemoryConsiderateLoading | ||
rm -rf node_modules build | ||
npm install | ||
npm run build | ||
mkdir -p "${multipleBuildsPath}${craMemoryConsiderateLoading}" | ||
cp -r $individualBuildAllFiles "${multipleBuildsPath}${craMemoryConsiderateLoading}" | ||
cd .. | ||
|
||
cd $craMemoryConsiderateLoadingSketchfab | ||
rm -rf node_modules build | ||
npm install | ||
npm run build | ||
mkdir -p "${multipleBuildsPath}${craMemoryConsiderateLoadingSketchfab}" | ||
cp -r $individualBuildAllFiles "${multipleBuildsPath}${craMemoryConsiderateLoadingSketchfab}" | ||
cd .. | ||
|
||
cd $craNetworkAwareCodeSplitting | ||
rm -rf node_modules build | ||
npm install | ||
npm run build | ||
mkdir -p "${multipleBuildsPath}${craNetworkAwareCodeSplitting}" | ||
cp -r $individualBuildAllFiles "${multipleBuildsPath}${craNetworkAwareCodeSplitting}" | ||
cd .. | ||
|
||
cd $craNetworkAwareComponent | ||
rm -rf node_modules build | ||
npm install | ||
npm run build | ||
mkdir -p "${multipleBuildsPath}${craNetworkAwareComponent}" | ||
cp -r $individualBuildAllFiles "${multipleBuildsPath}${craNetworkAwareComponent}" | ||
cd .. | ||
|
||
cd $craNetworkAwareDataFetching | ||
rm -rf node_modules build | ||
npm install | ||
npm run build | ||
mkdir -p "${multipleBuildsPath}${craNetworkAwareDataFetching}" | ||
cp -r $individualBuildAllFiles "${multipleBuildsPath}${craNetworkAwareDataFetching}" | ||
cd .. | ||
|
||
cd $craUaAwareCodeSplitting | ||
rm -rf node_modules build | ||
npm install | ||
npm run build | ||
mkdir -p "${multipleBuildsPath}${craUaAwareCodeSplitting}" | ||
cp -r $individualBuildAllFiles "${multipleBuildsPath}${craUaAwareCodeSplitting}" | ||
cd .. | ||
|
||
cd $reactMovieNetworkAwareComponents | ||
rm -rf node_modules build | ||
npm install | ||
npm run build | ||
mkdir -p "${multipleBuildsPath}${reactMovieNetworkAwareComponents}" | ||
cp -r $individualBuildAllFiles "${multipleBuildsPath}${reactMovieNetworkAwareComponents}" | ||
cd .. | ||
|
||
cd $reactShrineNetworkAwareCodeSplitting | ||
rm -rf node_modules build | ||
npm install | ||
npm run build | ||
mkdir -p "${multipleBuildsPath}${reactShrineNetworkAwareCodeSplitting}" | ||
cp -r $individualBuildAllFiles "${multipleBuildsPath}${reactShrineNetworkAwareCodeSplitting}" | ||
cd .. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
multipleBuildsPath="../functions/builds/" | ||
individualBuildAllFiles="build/*" | ||
|
||
craBatteryConsiderateLoading="cra-battery-considerate-loading" | ||
craDeviceClassAwareLoading="cra-device-class-aware-loading" | ||
craMemoryConsiderateLoading="cra-memory-considerate-loading" | ||
craMemoryConsiderateLoadingSketchfab="cra-memory-considerate-loading-sketchfab" | ||
craNetworkAwareCodeSplitting="cra-network-aware-code-splitting" | ||
craNetworkAwareComponent="cra-network-aware-component" | ||
craNetworkAwareDataFetching="cra-network-aware-data-fetching" | ||
craUaAwareCodeSplitting="cra-ua-aware-code-splitting" | ||
reactMovieNetworkAwareComponents="react-movie-network-aware-components" | ||
reactShrineNetworkAwareCodeSplitting="react-shrine-network-aware-code-splitting" | ||
|
||
cd functions | ||
rm -rf node_modules builds | ||
cd .. | ||
|
||
cd $craBatteryConsiderateLoading | ||
rm -rf node_modules build | ||
cd .. | ||
|
||
cd $craDeviceClassAwareLoading | ||
rm -rf node_modules build | ||
cd .. | ||
|
||
cd $craMemoryConsiderateLoading | ||
rm -rf node_modules build | ||
cd .. | ||
|
||
cd $craMemoryConsiderateLoadingSketchfab | ||
rm -rf node_modules build | ||
cd .. | ||
|
||
cd $craNetworkAwareCodeSplitting | ||
rm -rf node_modules build | ||
cd .. | ||
|
||
cd $craNetworkAwareComponent | ||
rm -rf node_modules build | ||
cd .. | ||
|
||
cd $craNetworkAwareDataFetching | ||
rm -rf node_modules build | ||
cd .. | ||
|
||
cd $craUaAwareCodeSplitting | ||
rm -rf node_modules build | ||
cd .. | ||
|
||
cd $reactMovieNetworkAwareComponents | ||
rm -rf node_modules build | ||
cd .. | ||
|
||
cd $reactShrineNetworkAwareCodeSplitting | ||
rm -rf node_modules build | ||
cd .. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "memory-based-loading", | ||
"name": "cra-memory-considerate-loading", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These changes all LGTM. Thanks for aligning the naming around a common scheme. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, thanks for your notice. |
||
"version": "0.1.0", | ||
"homepage": ".", | ||
"private": true, | ||
"dependencies": { | ||
"@google/model-viewer": "^0.5.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
[debug] [2019-07-29T20:50:45.874Z] ---------------------------------------------------------------------- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add firebase-debug.log to our gitignore? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes I'll do that. |
||
[debug] [2019-07-29T20:50:45.876Z] Command: C:\Program Files\nodejs\node.exe C:\Users\JIN\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js deploy | ||
[debug] [2019-07-29T20:50:45.876Z] CLI Version: 7.2.1 | ||
[debug] [2019-07-29T20:50:45.877Z] Platform: win32 | ||
[debug] [2019-07-29T20:50:45.877Z] Node Version: v10.15.3 | ||
[debug] [2019-07-29T20:50:45.877Z] Time: Mon Jul 29 2019 23:50:45 GMT+0300 (Moscow Standard Time) | ||
[debug] [2019-07-29T20:50:45.877Z] ---------------------------------------------------------------------- | ||
[debug] | ||
[debug] [2019-07-29T20:50:45.883Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"] | ||
[debug] [2019-07-29T20:50:45.883Z] > authorizing via signed-in user | ||
[debug] [2019-07-29T20:50:45.883Z] [iam] checking project env-aware for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"] | ||
[debug] [2019-07-29T20:50:45.884Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/env-aware:testIamPermissions | ||
|
||
[debug] [2019-07-29T20:50:47.084Z] <<< HTTP RESPONSE 200 | ||
[info] | ||
[info] === Deploying to 'env-aware'... | ||
[info] | ||
[info] i deploying functions | ||
[debug] [2019-07-29T20:50:51.023Z] > [functions] package.json contents: { | ||
"name": "functions", | ||
"description": "Cloud Functions for Firebase", | ||
"scripts": { | ||
"serve": "firebase serve --only functions", | ||
"shell": "firebase functions:shell", | ||
"start": "npm run shell", | ||
"deploy": "firebase deploy --only functions", | ||
"logs": "firebase functions:log" | ||
}, | ||
"engines": { | ||
"node": "8" | ||
}, | ||
"dependencies": { | ||
"firebase-admin": "^8.0.0", | ||
"firebase-functions": "^3.1.0", | ||
"cors": "^2.8.5", | ||
"deviceatlas-deviceapi": "file:lib/device-atlas/deviceatlas-enterprise-nodejs-2.1.3/Api/deviceatlas-deviceapi-2.1.3.tgz", | ||
"express": "^4.17.1", | ||
"mkdirp": "^0.5.1", | ||
"string-similarity": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"firebase-functions-test": "^0.1.6" | ||
}, | ||
"private": true | ||
} | ||
[info] i functions: ensuring necessary APIs are enabled... | ||
[debug] [2019-07-29T20:50:51.023Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/env-aware/services/cloudfunctions.googleapis.com | ||
|
||
[debug] [2019-07-29T20:50:51.024Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/env-aware/services/runtimeconfig.googleapis.com | ||
|
||
[debug] [2019-07-29T20:50:52.565Z] <<< HTTP RESPONSE 200 | ||
[debug] [2019-07-29T20:50:52.586Z] <<< HTTP RESPONSE 200 | ||
[info] + functions: all necessary APIs are enabled | ||
[debug] [2019-07-29T20:50:52.587Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/env-aware/adminSdkConfig | ||
|
||
[debug] [2019-07-29T20:50:53.403Z] <<< HTTP RESPONSE 200 | ||
[info] i functions: preparing functions directory for uploading... | ||
[debug] [2019-07-29T20:50:53.405Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/env-aware/configs | ||
|
||
[debug] [2019-07-29T20:50:53.961Z] <<< HTTP RESPONSE 200 | ||
[info] i functions: packaged functions (11.23 MB) for uploading | ||
[debug] [2019-07-29T20:50:56.306Z] >>> HTTP REQUEST POST https://cloudfunctions.googleapis.com/v1/projects/env-aware/locations/us-central1/functions:generateUploadUrl | ||
|
||
[debug] [2019-07-29T20:51:30.013Z] <<< HTTP RESPONSE 200 | ||
[debug] [2019-07-29T20:51:30.013Z] >>> HTTP REQUEST PUT https://storage.googleapis.com/gcf-upload-us-central1-9687512f-d70b-43eb-94e5-0f81623f4e03/a5529413-47b9-4f07-9851-326a8154adfb.zip?GoogleAccessId=service-1029663082851@gcf-admin-robot.iam.gserviceaccount.com&Expires=1564435290&Signature=fBsqdp8kXti0gNDWzKgEfhc%2BKqn4sIGOU7bG2CIVzDrvhuYpjAUU4uXzxneayiulqEhbve%2BRaZPZrD4Zv3v8r5kFGRE%2FZ34vCR9aBBxS49Zj2PMaCRc8AeFl5B6WXTOaVVepq0MELicaDNCl937ppZTY2XPRkn9TnBvIAyk2pGkcT8tLfu1CprOowwWcXco22r%2FSP0RqVB51AJqF7bk%2BbJc63xj4XKTl59Iwz1IT9k8GBZNbIfeMGD4IktPlXoTzvN0mkpEUzxnaR3PbaRucAqr%2F1FFDqhwOqQpKrXvYaWlTDNr7bLBx1J1Vbh5WQWTL9DfMjut1%2BVrpY2gNY%2Fa2CQ%3D%3D | ||
<request body omitted> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
builds/ | ||
node_modules/ | ||
firebase-debug.log | ||
.firebase/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"hosting": { | ||
"public": "builds", | ||
"rewrites": [ { | ||
"source": "**", | ||
"function": "app" | ||
} ] | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing to change with respect to this feedback, but leaving here for later:
In a typical review, I would normally say we should figure out how to define the list of subprojects in an array and iterate over the build and deploy steps for them in a loop as the steps are currently quite similar. That said, I actually like the flexibility we get with your current setup in case we need really granular control at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I totally agree with you.
I was eager to use loop and array of projects because the current version looks not professional and even hardcoded.
But on the other hand I thought I should not spend much time on secondary problems.
So just for now I described this bash script to the meaningful extend because I thought I could get back to this refinement when I get some free or extra time.
TODO is remained here :)