From c2f3890cf4b4e9859629e0f378db7c4ff6624ba0 Mon Sep 17 00:00:00 2001 From: Ben Chaimberg Date: Tue, 11 May 2021 12:07:33 -0700 Subject: [PATCH 1/2] chore(docs): clarify prerequisites in CONTRIBUTING and verify before build --- CONTRIBUTING.md | 5 ++++- scripts/check-build-prerequisites.sh | 33 ++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 5 deletions(-) mode change 100644 => 100755 scripts/check-build-prerequisites.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0762461d541d5..6a7065377b28e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,6 +56,8 @@ The following tools need to be installed on your system prior to installing the - [Yarn >= 1.19.1, < 2](https://yarnpkg.com/lang/en/docs/install) - [.NET Core SDK 3.1.x](https://www.microsoft.com/net/download) - [Python >= 3.6.5, < 4.0](https://www.python.org/downloads/release/python-365/) +- [Docker >= 19.03](https://docs.docker.com/get-docker/) + - the Docker daemon must also be running First fork the repository, and then run the following commands to clone the repository locally. @@ -113,8 +115,9 @@ However, if you wish to build the the entire repository, the following command w ```console cd -yarn build +scripts/foreach.sh yarn build ``` +Note: The `foreach` command is resumable by default; you must supply `-r` or `--reset` to start a new session. You are now ready to start contributing to the CDK. See the [Pull Requests](#pull-requests) section on how to make your changes and submit it as a pull request. diff --git a/scripts/check-build-prerequisites.sh b/scripts/check-build-prerequisites.sh old mode 100644 new mode 100755 index c703d9f3e94e7..749f88d1d90d7 --- a/scripts/check-build-prerequisites.sh +++ b/scripts/check-build-prerequisites.sh @@ -42,7 +42,7 @@ app_v=$(node --version) # Check for version 10.*.* - 29.*.* echo -e "Checking node version... \c" if [ $(echo $app_v | grep -c -E "v[12][0-9]\.[0-9]+\.[0-9]+") -eq 1 ] -then +then # Check for version 13.0 to 13.6 if [ $(echo $app_v | grep -c -E "v13\.[0-6]\.[0-9]+") -eq 1 ] then @@ -50,7 +50,7 @@ then else # Check for version < 10.13 if [ $(echo $app_v | grep -c -E "v10\.([0-9]|1[0-2])\.[0-9]+") -eq 1 ] - then + then wrong_version else echo "Ok" @@ -68,7 +68,7 @@ check_which $app $app_min app_v=$(${app} --version) echo -e "Checking yarn version... \c" if [ $(echo $app_v | grep -c -E "1\.(19|2[0-9])\.[0-9]+") -eq 1 ] -then +then echo "Ok" else wrong_version @@ -83,9 +83,34 @@ check_which $app $app_min echo -e "Checking if docker is running... \c" docker_running=$(docker ps) if [ $? -eq 0 ] -then +then echo "Ok" else die "Docker is not running" fi +# [.NET == 3.1.x] +app="dotnet" +app_min="3.1.0" +check_which $app $app_min +app_v=$(${app} --version) +echo -e "Checking dotnet version... \c" +if [ $(echo $app_v | grep -c -E "3\.1\.[0-9]+") -eq 1 ] +then + echo "Ok" +else + wrong_version +fi + +# [Python >= 3.6.5, < 4.0] +app="python" +app_min="3.6.5" +check_which $app $app_min +app_v=$(${app} --version) +echo -e "Checking python version... \c" +if [ $(echo $app_v | grep -c -E "3\.[6-9]+\.[0-9]+") -eq 1 ] +then + echo "Ok" +else + wrong_version +fi From 373a650e860a52bcc45319860d71cd57dcb2cc20 Mon Sep 17 00:00:00 2001 From: Ben Chaimberg Date: Tue, 11 May 2021 12:45:09 -0700 Subject: [PATCH 2/2] use python3 executable instead of python --- scripts/check-build-prerequisites.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/check-build-prerequisites.sh b/scripts/check-build-prerequisites.sh index 749f88d1d90d7..4414ff378a48d 100755 --- a/scripts/check-build-prerequisites.sh +++ b/scripts/check-build-prerequisites.sh @@ -103,11 +103,11 @@ else fi # [Python >= 3.6.5, < 4.0] -app="python" +app="python3" app_min="3.6.5" check_which $app $app_min app_v=$(${app} --version) -echo -e "Checking python version... \c" +echo -e "Checking python3 version... \c" if [ $(echo $app_v | grep -c -E "3\.[6-9]+\.[0-9]+") -eq 1 ] then echo "Ok"