From 67a7483754f85eaeff58a9ecb63419d8a21e2576 Mon Sep 17 00:00:00 2001 From: ryanml Date: Tue, 9 Aug 2022 09:08:34 -0700 Subject: [PATCH] Adding option to update lavamoat policies in parallel (#14536) Co-authored-by: brad-decker --- development/generate-lavamoat-policies.sh | 13 ++++++++++--- package.json | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/development/generate-lavamoat-policies.sh b/development/generate-lavamoat-policies.sh index fe91aaeaf..d50967865 100755 --- a/development/generate-lavamoat-policies.sh +++ b/development/generate-lavamoat-policies.sh @@ -4,9 +4,16 @@ set -e set -u set -o pipefail +extraArgs=() +if [[ $# -lt 1 ]]; then + extraArgs+=(-m 1) +fi + # Generate LavaMoat policies for the extension background script for each build # type. # ATTN: This may tax your device when running it locally. -WRITE_AUTO_POLICY=1 yarn build scripts:prod --policy-only && -WRITE_AUTO_POLICY=1 yarn build scripts:prod --policy-only --build-type beta && -WRITE_AUTO_POLICY=1 yarn build scripts:prod --policy-only --build-type flask +concurrently --kill-others-on-fail -n main,beta,flask \ + "${extraArgs[@]}" \ + "WRITE_AUTO_POLICY=1 yarn build scripts:prod --policy-only" \ + "WRITE_AUTO_POLICY=1 yarn build scripts:prod --policy-only --build-type beta" \ + "WRITE_AUTO_POLICY=1 yarn build scripts:prod --policy-only --build-type flask" \ No newline at end of file diff --git a/package.json b/package.json index 2b88f1a14..4dc090537 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,7 @@ "lavamoat:build:auto": "yarn lavamoat:build --writeAutoPolicy", "lavamoat:debug:build": "yarn lavamoat:build --writeAutoPolicyDebug --policydebug lavamoat/build-system/policy-debug.json", "lavamoat:background:auto": "./development/generate-lavamoat-policies.sh", + "lavamoat:background:auto:dev": "./development/generate-lavamoat-policies.sh --dev", "lavamoat:auto": "yarn lavamoat:build:auto && yarn lavamoat:background:auto" }, "resolutions": {