This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(scripts): foreach.sh --up (aws#5648)
Add support for `--up` in `foreach.sh` which will execute the command for the current module and all its dependencies (instead of the entire repo). Use this new feature in `buildup` so from now, `buildup` is resumable. Restart can be done through `./buildup --restart`. Update CONTRIBUTING guide.
- Loading branch information
Elad Ben-Israel
authored
Jan 6, 2020
1 parent
9472e09
commit 3b5959f
Showing
3 changed files
with
48 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
scriptdir=$(cd $(dirname $0) && pwd) | ||
|
||
echo "************************************************************" | ||
echo " buildup usage:" | ||
echo " - execute 'buildup' again to resume after failure" | ||
echo " - execute 'buildup --restart' to restart" | ||
echo "" | ||
echo " for advanced usage, see ${scriptdir}/foreach.sh" | ||
echo "************************************************************" | ||
|
||
if ! [ -x "$(command -v yarn)" ]; then | ||
echo "yarn is not installed. Install it from here- https://yarnpkg.com/en/docs/install." | ||
exit 1 | ||
if [ "${1:-}" == "--restart" ] || [ "${1:-}" == "--reset" ]; then | ||
${scriptdir}/foreach.sh --reset | ||
fi | ||
|
||
export NODE_OPTIONS="--max-old-space-size=4096 ${NODE_OPTIONS:-}" | ||
|
||
scriptdir=$(cd $(dirname $0) && pwd) | ||
export PATH=$(cd $scriptdir && npm bin):$PATH | ||
scope=$(${scriptdir}/current-scope) | ||
exec lerna run build --scope ${scope} --include-dependencies | ||
${scriptdir}/foreach.sh --up yarn build | ||
${scriptdir}/foreach.sh --reset | ||
|
||
echo "************************************************************" | ||
echo "buildup done" | ||
echo "************************************************************" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters