Skip to content

Commit 13cb602

Browse files
bvaughnjetoneza
authored andcommitted
Save CI-built node_modules as build artifacts (facebook#14205)
* Store node_modules generated by CI script as an artifact * NPM pack artifacts before archiving
1 parent 6ee3804 commit 13cb602

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.circleci/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ jobs:
4040
key: v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
4141
paths:
4242
- node_modules
43+
44+
- store_artifacts:
45+
path: ./node_modules.tgz
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# NPM pack all modules to ensure we archive the correct set of files
6+
for dir in ./build/node_modules/* ; do
7+
npm pack "$dir"
8+
done
9+
10+
# Wrap everything in a single zip file for easy download by the publish script
11+
tar -zcvf ./node_modules.tgz ./*.tgz

scripts/circleci/test_entry_point.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ if [ $((2 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
3030
COMMANDS_TO_RUN+=('yarn test-build-prod --maxWorkers=2')
3131
COMMANDS_TO_RUN+=('node ./scripts/tasks/danger')
3232
COMMANDS_TO_RUN+=('./scripts/circleci/upload_build.sh')
33+
COMMANDS_TO_RUN+=('./scripts/circleci/pack_and_store_artifact.sh')
3334
fi
3435

3536
if [ $((3 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then

0 commit comments

Comments
 (0)