Save CI-built node_modules as build artifacts (#14205)
* Store node_modules generated by CI script as an artifact * NPM pack artifacts before archiving
Brian Vaughn committed
Nov 13, 2018 at 11:00 UTC
85f5a81eb72d7d736423ca31bfd2323d2ceea460
3 files changed
+15
.circleci/config.yml
+3
@@ -40,3 +40,6 @@ jobs:
40
key: v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
41
paths:
42
- node_modules
43
+
44
+ - store_artifacts:
45
+ path: ./node_modules.tgz
\ No newline at end of file
scripts/circleci/pack_and_store_artifact.sh
new
+11
@@ -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
\ No newline at end of file
scripts/circleci/test_entry_point.sh
+1
@@ -30,6 +30,7 @@ if [ $((2 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
30
COMMANDS_TO_RUN+=('yarn test-build-prod --maxWorkers=2')
31
COMMANDS_TO_RUN+=('node ./scripts/tasks/danger')
32
COMMANDS_TO_RUN+=('./scripts/circleci/upload_build.sh')
33
+ COMMANDS_TO_RUN+=('./scripts/circleci/pack_and_store_artifact.sh')
34
fi
35
36
if [ $((3 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then