Save CI-built node_modules as build artifacts (#14205)

* Store node_modules generated by CI script as an artifact
* NPM pack artifacts before archiving
This commit is contained in:
Brian Vaughn
2018-11-13 11:00:30 -08:00
committed by GitHub
parent f55795c8ee
commit 85f5a81eb7
3 changed files with 15 additions and 0 deletions

View File

@@ -40,3 +40,6 @@ jobs:
key: v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- node_modules
- store_artifacts:
path: ./node_modules.tgz

View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -e
# NPM pack all modules to ensure we archive the correct set of files
for dir in ./build/node_modules/* ; do
npm pack "$dir"
done
# Wrap everything in a single zip file for easy download by the publish script
tar -zcvf ./node_modules.tgz ./*.tgz

View File

@@ -30,6 +30,7 @@ if [ $((2 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
COMMANDS_TO_RUN+=('yarn test-build-prod --maxWorkers=2')
COMMANDS_TO_RUN+=('node ./scripts/tasks/danger')
COMMANDS_TO_RUN+=('./scripts/circleci/upload_build.sh')
COMMANDS_TO_RUN+=('./scripts/circleci/pack_and_store_artifact.sh')
fi
if [ $((3 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then