react/scripts/circleci/upload_build.sh
Andrew Clark 1cc3bba004
Parallelizes the build script across multiple processes (#15716)
* Write size info to separate file per bundle

`bundle-sizes.json` contains the combined size information for every
build. This makes it easier to store and process, but it prevents us
from parallelizing the build script, because each process would need to
write to the same file.

So I've updated the Rollup script to output individual files per build.
A downstream CI job consolidates them into a single file.

I have not parallelized the Rollup script yet. I'll do that next.

* Parallelize the build script

Uses CircleCI's `parallelism` config option to spin up multiple build
processes.
2019-05-29 14:34:50 -07:00

21 lines
848 B
Bash
Executable File

#!/bin/bash
set -e
if [ -z "$CI_PULL_REQUEST" ] && [ -n "$BUILD_SERVER_ENDPOINT" ]; then
curl \
-F "react.development=@build/dist/react.development.js" \
-F "react.production.min=@build/dist/react.production.min.js" \
-F "react-dom.development=@build/dist/react-dom.development.js" \
-F "react-dom.production.min=@build/dist/react-dom.production.min.js" \
-F "react-dom-server.browser.development=@build/dist/react-dom-server.browser.development.js" \
-F "react-dom-server.browser.production.min=@build/dist/react-dom-server.browser.production.min.js" \
-F "results.json=@build/../build/bundle-sizes.json" \
-F "commit=$CIRCLE_SHA1" \
-F "date=$(git log --format='%ct' -1)" \
-F "pull_request=false" \
-F "token=$BUILD_SERVER_TOKEN" \
-F "branch=$CIRCLE_BRANCH" \
"$BUILD_SERVER_ENDPOINT"
fi