From de67defb142c0be03c5b16b70ee1ea586905b26b Mon Sep 17 00:00:00 2001 From: nturgut Date: Wed, 26 Feb 2020 08:44:01 -0800 Subject: [PATCH 01/22] script for fetching correct flutter version --- .cirrus.yml | 5 +---- clone_flutter.sh | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 clone_flutter.sh diff --git a/.cirrus.yml b/.cirrus.yml index bbc78e709c1bd..d408db8b84f96 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -11,10 +11,7 @@ web_shard_template: &WEB_SHARD_TEMPLATE ./flutter/tools/gn --unoptimized --full-dart-sdk ninja -C out/host_debug_unopt fetch_framework_script: | - mkdir -p $FRAMEWORK_PATH - cd $FRAMEWORK_PATH - git clone https://github.com/flutter/flutter.git - cd flutter + ./flutter/clone_flutter.sh bin/flutter update-packages --local-engine=host_debug_unopt script: - dart --enable-asserts $FRAMEWORK_PATH/flutter/dev/bots/test.dart --local-engine=host_debug_unopt diff --git a/clone_flutter.sh b/clone_flutter.sh new file mode 100644 index 0000000000000..3158003859711 --- /dev/null +++ b/clone_flutter.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e + +echo "Framework path: $FRAMEWORK_PATH" + +# Get latest commit's time for the engine repo. +# Use date based on local time otherwise timezones might get mixed. +LATEST_COMMIT_TIME_ENGINE=`git log -1 --date=local --format="%ad"` +echo "Latest commit time on engine found as $LATEST_COMMIT_TIME_ENGINE" +mkdir -p $FRAMEWORK_PATH +cd $FRAMEWORK_PATH +# Clone the Flutter Framework. +git clone https://github.com/flutter/flutter.git +cd flutter +# Get the time of the youngest commit older than engine commit. +# Before makes the comparison considering the timezone as well. +COMMIT_NO=`git log --before="$LATEST_COMMIT_TIME_ENGINE" -n 1 | grep commit | cut -d ' ' -f2` +echo "Using the flutter/flutter commit $COMMIT_NO"; +git reset --hard $COMMIT_NO From aaf5c00b59c0cb680d06893f2537110f0a5cbb0d Mon Sep 17 00:00:00 2001 From: nturgut Date: Wed, 26 Feb 2020 09:10:39 -0800 Subject: [PATCH 02/22] change cirrus yml for the script location --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index d408db8b84f96..9c92d3b9a51bd 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -11,7 +11,7 @@ web_shard_template: &WEB_SHARD_TEMPLATE ./flutter/tools/gn --unoptimized --full-dart-sdk ninja -C out/host_debug_unopt fetch_framework_script: | - ./flutter/clone_flutter.sh + ./clone_flutter.sh bin/flutter update-packages --local-engine=host_debug_unopt script: - dart --enable-asserts $FRAMEWORK_PATH/flutter/dev/bots/test.dart --local-engine=host_debug_unopt From ab4396b9c4a6e4993dd68ee416f62928287e3479 Mon Sep 17 00:00:00 2001 From: nturgut Date: Wed, 26 Feb 2020 09:26:30 -0800 Subject: [PATCH 03/22] change location of the script. Add it to tools --- .cirrus.yml | 2 +- clone_flutter.sh => tools/clone_flutter.sh | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename clone_flutter.sh => tools/clone_flutter.sh (100%) mode change 100644 => 100755 diff --git a/.cirrus.yml b/.cirrus.yml index 9c92d3b9a51bd..b494a7c70fd32 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -11,7 +11,7 @@ web_shard_template: &WEB_SHARD_TEMPLATE ./flutter/tools/gn --unoptimized --full-dart-sdk ninja -C out/host_debug_unopt fetch_framework_script: | - ./clone_flutter.sh + ./flutter/tools/clone_flutter.sh bin/flutter update-packages --local-engine=host_debug_unopt script: - dart --enable-asserts $FRAMEWORK_PATH/flutter/dev/bots/test.dart --local-engine=host_debug_unopt diff --git a/clone_flutter.sh b/tools/clone_flutter.sh old mode 100644 new mode 100755 similarity index 100% rename from clone_flutter.sh rename to tools/clone_flutter.sh From fd54619a2ecdada70afc0de10e3ad66359748afe Mon Sep 17 00:00:00 2001 From: nturgut Date: Wed, 26 Feb 2020 09:39:33 -0800 Subject: [PATCH 04/22] cirrus still does not see the script. repeat path change from the previous step --- .cirrus.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.cirrus.yml b/.cirrus.yml index b494a7c70fd32..81da5755b4f86 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -11,6 +11,7 @@ web_shard_template: &WEB_SHARD_TEMPLATE ./flutter/tools/gn --unoptimized --full-dart-sdk ninja -C out/host_debug_unopt fetch_framework_script: | + cd $ENGINE_PATH/src ./flutter/tools/clone_flutter.sh bin/flutter update-packages --local-engine=host_debug_unopt script: From bc4bc65616416d4a0f7093f2a5706c551ed66320 Mon Sep 17 00:00:00 2001 From: nturgut Date: Wed, 26 Feb 2020 09:54:43 -0800 Subject: [PATCH 05/22] Looks like script worked correctly. do not change directory. --- .cirrus.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 81da5755b4f86..7738625dbc43b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -11,8 +11,7 @@ web_shard_template: &WEB_SHARD_TEMPLATE ./flutter/tools/gn --unoptimized --full-dart-sdk ninja -C out/host_debug_unopt fetch_framework_script: | - cd $ENGINE_PATH/src - ./flutter/tools/clone_flutter.sh + $ENGINE_PATH/src/flutter/tools/clone_flutter.sh bin/flutter update-packages --local-engine=host_debug_unopt script: - dart --enable-asserts $FRAMEWORK_PATH/flutter/dev/bots/test.dart --local-engine=host_debug_unopt From 66595f0ef6b7f39ed6bf1c0491fd53be70bc0b57 Mon Sep 17 00:00:00 2001 From: nturgut Date: Wed, 26 Feb 2020 10:12:04 -0800 Subject: [PATCH 06/22] change directory back to build root after scriot is run --- .cirrus.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 7738625dbc43b..b1a388984cab9 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -11,7 +11,9 @@ web_shard_template: &WEB_SHARD_TEMPLATE ./flutter/tools/gn --unoptimized --full-dart-sdk ninja -C out/host_debug_unopt fetch_framework_script: | - $ENGINE_PATH/src/flutter/tools/clone_flutter.sh + cd $ENGINE_PATH/src + ./flutter/tools/clone_flutter.sh + cd ../.. bin/flutter update-packages --local-engine=host_debug_unopt script: - dart --enable-asserts $FRAMEWORK_PATH/flutter/dev/bots/test.dart --local-engine=host_debug_unopt From 2dd118cbc27875135b4dbe510c344d6f725add04 Mon Sep 17 00:00:00 2001 From: nturgut Date: Wed, 26 Feb 2020 10:26:54 -0800 Subject: [PATCH 07/22] script runs ok. Still not able to find the bin directory. go all the way back --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index b1a388984cab9..9ad334a1c4929 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -13,7 +13,7 @@ web_shard_template: &WEB_SHARD_TEMPLATE fetch_framework_script: | cd $ENGINE_PATH/src ./flutter/tools/clone_flutter.sh - cd ../.. + cd ../../../.. bin/flutter update-packages --local-engine=host_debug_unopt script: - dart --enable-asserts $FRAMEWORK_PATH/flutter/dev/bots/test.dart --local-engine=host_debug_unopt From 5c49aa597350f3130e59e69cee10b68e3959737c Mon Sep 17 00:00:00 2001 From: nturgut Date: Wed, 26 Feb 2020 10:57:37 -0800 Subject: [PATCH 08/22] still can't see the bin directory. carry the script content to cirrus.yml to debug better --- .cirrus.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 9ad334a1c4929..b592ee6b4d341 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -11,9 +11,16 @@ web_shard_template: &WEB_SHARD_TEMPLATE ./flutter/tools/gn --unoptimized --full-dart-sdk ninja -C out/host_debug_unopt fetch_framework_script: | - cd $ENGINE_PATH/src - ./flutter/tools/clone_flutter.sh - cd ../../../.. + echo "Framework path: $FRAMEWORK_PATH" + LATEST_COMMIT_TIME_ENGINE=`git log -1 --date=local --format="%ad"` + echo "Latest commit time on engine found as $LATEST_COMMIT_TIME_ENGINE" + mkdir -p $FRAMEWORK_PATH + cd $FRAMEWORK_PATH + git clone https://github.com/flutter/flutter.git + cd flutter + COMMIT_NO=`git log --before="$LATEST_COMMIT_TIME_ENGINE" -n 1 | grep commit | cut -d ' ' -f2` + echo "Using the flutter/flutter commit $COMMIT_NO"; + git reset --hard $COMMIT_NO bin/flutter update-packages --local-engine=host_debug_unopt script: - dart --enable-asserts $FRAMEWORK_PATH/flutter/dev/bots/test.dart --local-engine=host_debug_unopt From e60e8622769fae3e11eb27c22252ef79131d3617 Mon Sep 17 00:00:00 2001 From: nturgut Date: Wed, 26 Feb 2020 11:15:23 -0800 Subject: [PATCH 09/22] get the last commit id of the right repository --- .cirrus.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index b592ee6b4d341..e61256b5fdbb3 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -12,8 +12,10 @@ web_shard_template: &WEB_SHARD_TEMPLATE ninja -C out/host_debug_unopt fetch_framework_script: | echo "Framework path: $FRAMEWORK_PATH" + cd $ENGINE_PATH/src/flutter LATEST_COMMIT_TIME_ENGINE=`git log -1 --date=local --format="%ad"` echo "Latest commit time on engine found as $LATEST_COMMIT_TIME_ENGINE" + cd ~ mkdir -p $FRAMEWORK_PATH cd $FRAMEWORK_PATH git clone https://github.com/flutter/flutter.git From 7a1325f034e0a4908b397d1faf315f04a66fb8fa Mon Sep 17 00:00:00 2001 From: nturgut Date: Wed, 26 Feb 2020 12:01:27 -0800 Subject: [PATCH 10/22] content of the script worked in cirrus. call the script from tools --- .cirrus.yml | 13 +------------ tools/clone_flutter.sh | 6 ++++++ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index e61256b5fdbb3..b9dada446928b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -11,18 +11,7 @@ web_shard_template: &WEB_SHARD_TEMPLATE ./flutter/tools/gn --unoptimized --full-dart-sdk ninja -C out/host_debug_unopt fetch_framework_script: | - echo "Framework path: $FRAMEWORK_PATH" - cd $ENGINE_PATH/src/flutter - LATEST_COMMIT_TIME_ENGINE=`git log -1 --date=local --format="%ad"` - echo "Latest commit time on engine found as $LATEST_COMMIT_TIME_ENGINE" - cd ~ - mkdir -p $FRAMEWORK_PATH - cd $FRAMEWORK_PATH - git clone https://github.com/flutter/flutter.git - cd flutter - COMMIT_NO=`git log --before="$LATEST_COMMIT_TIME_ENGINE" -n 1 | grep commit | cut -d ' ' -f2` - echo "Using the flutter/flutter commit $COMMIT_NO"; - git reset --hard $COMMIT_NO + ./$ENGINE_PATH/src/flutter/tools/clone_flutter.sh bin/flutter update-packages --local-engine=host_debug_unopt script: - dart --enable-asserts $FRAMEWORK_PATH/flutter/dev/bots/test.dart --local-engine=host_debug_unopt diff --git a/tools/clone_flutter.sh b/tools/clone_flutter.sh index 3158003859711..33350eecba5c0 100755 --- a/tools/clone_flutter.sh +++ b/tools/clone_flutter.sh @@ -1,12 +1,18 @@ #!/bin/bash set -e + echo "Framework path: $FRAMEWORK_PATH" +# Go to the engine git repo to get the date of the latest commit. +cd $ENGINE_PATH/src/flutter # Get latest commit's time for the engine repo. # Use date based on local time otherwise timezones might get mixed. LATEST_COMMIT_TIME_ENGINE=`git log -1 --date=local --format="%ad"` echo "Latest commit time on engine found as $LATEST_COMMIT_TIME_ENGINE" + +# Do rest of the task in the root directory +cd ~ mkdir -p $FRAMEWORK_PATH cd $FRAMEWORK_PATH # Clone the Flutter Framework. From 6d3afaa865bc8ea7ae023d6f78fa7cac106e663d Mon Sep 17 00:00:00 2001 From: nturgut Date: Wed, 26 Feb 2020 12:27:53 -0800 Subject: [PATCH 11/22] cannot find the script under tools --- .cirrus.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index b9dada446928b..6bce7444eb84e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -11,7 +11,8 @@ web_shard_template: &WEB_SHARD_TEMPLATE ./flutter/tools/gn --unoptimized --full-dart-sdk ninja -C out/host_debug_unopt fetch_framework_script: | - ./$ENGINE_PATH/src/flutter/tools/clone_flutter.sh + cd $ENGINE_PATH/src/flutter/tools + ./clone_flutter.sh bin/flutter update-packages --local-engine=host_debug_unopt script: - dart --enable-asserts $FRAMEWORK_PATH/flutter/dev/bots/test.dart --local-engine=host_debug_unopt From 63c3a8a48fcb895c27db9c0e95227145ad12a9ca Mon Sep 17 00:00:00 2001 From: nturgut Date: Wed, 26 Feb 2020 12:55:44 -0800 Subject: [PATCH 12/22] print the current path in the script to see why cirrus cannot see bin directory --- .cirrus.yml | 1 + tools/clone_flutter.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index 6bce7444eb84e..47dcaa93952a2 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -13,6 +13,7 @@ web_shard_template: &WEB_SHARD_TEMPLATE fetch_framework_script: | cd $ENGINE_PATH/src/flutter/tools ./clone_flutter.sh + pwd bin/flutter update-packages --local-engine=host_debug_unopt script: - dart --enable-asserts $FRAMEWORK_PATH/flutter/dev/bots/test.dart --local-engine=host_debug_unopt diff --git a/tools/clone_flutter.sh b/tools/clone_flutter.sh index 33350eecba5c0..92eab84010a97 100755 --- a/tools/clone_flutter.sh +++ b/tools/clone_flutter.sh @@ -23,3 +23,4 @@ cd flutter COMMIT_NO=`git log --before="$LATEST_COMMIT_TIME_ENGINE" -n 1 | grep commit | cut -d ' ' -f2` echo "Using the flutter/flutter commit $COMMIT_NO"; git reset --hard $COMMIT_NO +pwd From 939a9c057b59abba4872f455984434fa488c61ad Mon Sep 17 00:00:00 2001 From: nturgut Date: Wed, 26 Feb 2020 13:20:34 -0800 Subject: [PATCH 13/22] move to flutter path before running update packages --- .cirrus.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.cirrus.yml b/.cirrus.yml index 47dcaa93952a2..de246a86b2b1f 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -13,6 +13,7 @@ web_shard_template: &WEB_SHARD_TEMPLATE fetch_framework_script: | cd $ENGINE_PATH/src/flutter/tools ./clone_flutter.sh + cd $FRAMEWORK_PATH/flutter pwd bin/flutter update-packages --local-engine=host_debug_unopt script: From daa88846ae4bafab008e31949339ae22b5242f5f Mon Sep 17 00:00:00 2001 From: nturgut Date: Wed, 26 Feb 2020 13:40:10 -0800 Subject: [PATCH 14/22] tests run now. remove print outs --- .cirrus.yml | 1 - tools/clone_flutter.sh | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index de246a86b2b1f..454f849b81064 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -14,7 +14,6 @@ web_shard_template: &WEB_SHARD_TEMPLATE cd $ENGINE_PATH/src/flutter/tools ./clone_flutter.sh cd $FRAMEWORK_PATH/flutter - pwd bin/flutter update-packages --local-engine=host_debug_unopt script: - dart --enable-asserts $FRAMEWORK_PATH/flutter/dev/bots/test.dart --local-engine=host_debug_unopt diff --git a/tools/clone_flutter.sh b/tools/clone_flutter.sh index 92eab84010a97..d41385bff485f 100755 --- a/tools/clone_flutter.sh +++ b/tools/clone_flutter.sh @@ -2,8 +2,6 @@ set -e -echo "Framework path: $FRAMEWORK_PATH" - # Go to the engine git repo to get the date of the latest commit. cd $ENGINE_PATH/src/flutter # Get latest commit's time for the engine repo. @@ -23,4 +21,4 @@ cd flutter COMMIT_NO=`git log --before="$LATEST_COMMIT_TIME_ENGINE" -n 1 | grep commit | cut -d ' ' -f2` echo "Using the flutter/flutter commit $COMMIT_NO"; git reset --hard $COMMIT_NO -pwd + From 5887ede020e1afd57cafbbf0ddb59439a15b8276 Mon Sep 17 00:00:00 2001 From: nturgut Date: Thu, 27 Feb 2020 14:15:17 -0800 Subject: [PATCH 15/22] error if the ENGINE_PATH is not set. exit the script --- tools/clone_flutter.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/clone_flutter.sh b/tools/clone_flutter.sh index d41385bff485f..25e153fb2f2c5 100755 --- a/tools/clone_flutter.sh +++ b/tools/clone_flutter.sh @@ -2,6 +2,12 @@ set -e +if [ -z $ENGINE_PATH ] +then + echo "This script is aimed to be run on CI environments. Do not run locally." + exit 1 +fi + # Go to the engine git repo to get the date of the latest commit. cd $ENGINE_PATH/src/flutter # Get latest commit's time for the engine repo. @@ -21,4 +27,3 @@ cd flutter COMMIT_NO=`git log --before="$LATEST_COMMIT_TIME_ENGINE" -n 1 | grep commit | cut -d ' ' -f2` echo "Using the flutter/flutter commit $COMMIT_NO"; git reset --hard $COMMIT_NO - From 4c9fce04d037803e6ebabbac16fa8cf3dad3fdec Mon Sep 17 00:00:00 2001 From: nturgut Date: Thu, 27 Feb 2020 17:34:49 -0800 Subject: [PATCH 16/22] addressing reviewer comments --- tools/clone_flutter.sh | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/tools/clone_flutter.sh b/tools/clone_flutter.sh index 25e153fb2f2c5..13be5b9feeabf 100755 --- a/tools/clone_flutter.sh +++ b/tools/clone_flutter.sh @@ -1,6 +1,6 @@ #!/bin/bash set -e - +set -x if [ -z $ENGINE_PATH ] then @@ -8,6 +8,17 @@ then exit 1 fi +# Special handling of release branches. +ENGINE_BRANCH_NAME=`git branch | grep '*' | cut -d ' ' '-f2'` +versionregex="v[[:digit:]]+\.{1}" +ON_RELEASE_BRANCH=false +echo "Engine on branch $ENGINE_BRANCH_NAME" +if [[ $ENGINE_BRANCH_NAME =~ $versionregex ]] +then + echo "release branch $ENGINE_BRANCH_NAME" + ON_RELEASE_BRANCH=true +fi + # Go to the engine git repo to get the date of the latest commit. cd $ENGINE_PATH/src/flutter # Get latest commit's time for the engine repo. @@ -22,7 +33,24 @@ cd $FRAMEWORK_PATH # Clone the Flutter Framework. git clone https://github.com/flutter/flutter.git cd flutter + +FRAMEWORK_BRANCH_NAME=`git branch | grep '*' | cut -d ' ' '-f2'` +if [[ "$ON_RELEASE_BRANCH" = true && ENGINE_BRANCH_NAME != FRAMEWORK_BRANCH_NAME ]] +then + echo "For a release framework and engine should be on the same version." + echo "Switching branches on Framework to from $FRAMEWORK_BRANCH_NAME to $ENGINE_BRANCH_NAME" + # Switch to the same version branch with the engine. + # If same version branch does not exits, fail. + SWITCH_RESULT=`git checkout $ENGINE_BRANCH_NAME` || true + if [[ -z "$SWITCH_RESULT" ]] + then + echo "$ENGINE_BRANCH_NAME Branch not found on framework. Quit." + exit 1 + fi +fi + # Get the time of the youngest commit older than engine commit. +# Git log uses commit date not the author date. # Before makes the comparison considering the timezone as well. COMMIT_NO=`git log --before="$LATEST_COMMIT_TIME_ENGINE" -n 1 | grep commit | cut -d ' ' -f2` echo "Using the flutter/flutter commit $COMMIT_NO"; From e88bcb2397a22509d0dd186d8b2e4a924ca893ad Mon Sep 17 00:00:00 2001 From: nturgut Date: Thu, 27 Feb 2020 17:56:29 -0800 Subject: [PATCH 17/22] engine branch name on cirrus logs doesn't make sense --- tools/clone_flutter.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/clone_flutter.sh b/tools/clone_flutter.sh index 13be5b9feeabf..6c00168f9204b 100755 --- a/tools/clone_flutter.sh +++ b/tools/clone_flutter.sh @@ -9,6 +9,9 @@ then fi # Special handling of release branches. +BRANCH_NAME=`git branch | grep '*' +echo "$BRANCH_NAME" + ENGINE_BRANCH_NAME=`git branch | grep '*' | cut -d ' ' '-f2'` versionregex="v[[:digit:]]+\.{1}" ON_RELEASE_BRANCH=false From 4712ab5aeab28b371054bb9167312eba02f8994d Mon Sep 17 00:00:00 2001 From: nturgut Date: Thu, 27 Feb 2020 18:20:48 -0800 Subject: [PATCH 18/22] fix typo --- tools/clone_flutter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/clone_flutter.sh b/tools/clone_flutter.sh index 6c00168f9204b..0c1a2175053b0 100755 --- a/tools/clone_flutter.sh +++ b/tools/clone_flutter.sh @@ -9,7 +9,7 @@ then fi # Special handling of release branches. -BRANCH_NAME=`git branch | grep '*' +BRANCH_NAME=`git branch | grep '*'` echo "$BRANCH_NAME" ENGINE_BRANCH_NAME=`git branch | grep '*' | cut -d ' ' '-f2'` From 1fc87e9fd4850274050d043be4781374adac50f8 Mon Sep 17 00:00:00 2001 From: nturgut Date: Thu, 27 Feb 2020 18:45:01 -0800 Subject: [PATCH 19/22] change the directory of branch calculation --- tools/clone_flutter.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/clone_flutter.sh b/tools/clone_flutter.sh index 0c1a2175053b0..a40b50307e4c9 100755 --- a/tools/clone_flutter.sh +++ b/tools/clone_flutter.sh @@ -8,6 +8,9 @@ then exit 1 fi +# Go to the engine git repo to get the date of the latest commit. +cd $ENGINE_PATH/src/flutter + # Special handling of release branches. BRANCH_NAME=`git branch | grep '*'` echo "$BRANCH_NAME" @@ -22,8 +25,6 @@ then ON_RELEASE_BRANCH=true fi -# Go to the engine git repo to get the date of the latest commit. -cd $ENGINE_PATH/src/flutter # Get latest commit's time for the engine repo. # Use date based on local time otherwise timezones might get mixed. LATEST_COMMIT_TIME_ENGINE=`git log -1 --date=local --format="%ad"` From 618a17618ce90624d164d07ece22917cb320583e Mon Sep 17 00:00:00 2001 From: nturgut Date: Thu, 27 Feb 2020 19:01:07 -0800 Subject: [PATCH 20/22] remove extra logs --- tools/clone_flutter.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/clone_flutter.sh b/tools/clone_flutter.sh index a40b50307e4c9..b9f5e05ae91d5 100755 --- a/tools/clone_flutter.sh +++ b/tools/clone_flutter.sh @@ -12,9 +12,6 @@ fi cd $ENGINE_PATH/src/flutter # Special handling of release branches. -BRANCH_NAME=`git branch | grep '*'` -echo "$BRANCH_NAME" - ENGINE_BRANCH_NAME=`git branch | grep '*' | cut -d ' ' '-f2'` versionregex="v[[:digit:]]+\.{1}" ON_RELEASE_BRANCH=false From c39a4aee979f0d7d6fcb4d52e36d6410362fc70d Mon Sep 17 00:00:00 2001 From: nturgut Date: Fri, 28 Feb 2020 10:43:21 -0800 Subject: [PATCH 21/22] addressing PR comments. Testing CIRRUS_CI env variable --- tools/clone_flutter.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/clone_flutter.sh b/tools/clone_flutter.sh index b9f5e05ae91d5..b7c51620edc0f 100755 --- a/tools/clone_flutter.sh +++ b/tools/clone_flutter.sh @@ -2,7 +2,9 @@ set -e set -x -if [ -z $ENGINE_PATH ] +echo "is cirrus ci: $CIRRUS_CI" + +if [[ -z $ENGINE_PATH ]] then echo "This script is aimed to be run on CI environments. Do not run locally." exit 1 @@ -12,8 +14,8 @@ fi cd $ENGINE_PATH/src/flutter # Special handling of release branches. -ENGINE_BRANCH_NAME=`git branch | grep '*' | cut -d ' ' '-f2'` -versionregex="v[[:digit:]]+\.{1}" +ENGINE_BRANCH_NAME=`git branch | grep '*' | cut -d ' ' -f2` +versionregex="^v[[:digit:]]+\." ON_RELEASE_BRANCH=false echo "Engine on branch $ENGINE_BRANCH_NAME" if [[ $ENGINE_BRANCH_NAME =~ $versionregex ]] @@ -35,7 +37,7 @@ cd $FRAMEWORK_PATH git clone https://github.com/flutter/flutter.git cd flutter -FRAMEWORK_BRANCH_NAME=`git branch | grep '*' | cut -d ' ' '-f2'` +FRAMEWORK_BRANCH_NAME=`git branch | grep '*' | cut -d ' ' -f2` if [[ "$ON_RELEASE_BRANCH" = true && ENGINE_BRANCH_NAME != FRAMEWORK_BRANCH_NAME ]] then echo "For a release framework and engine should be on the same version." From 156bd65ab26dd69002215a84901cbc5d16dbdf9b Mon Sep 17 00:00:00 2001 From: nturgut Date: Fri, 28 Feb 2020 11:39:19 -0800 Subject: [PATCH 22/22] adding CIRRUS_CI check --- tools/clone_flutter.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/clone_flutter.sh b/tools/clone_flutter.sh index b7c51620edc0f..a4f49ce2110b1 100755 --- a/tools/clone_flutter.sh +++ b/tools/clone_flutter.sh @@ -2,11 +2,15 @@ set -e set -x -echo "is cirrus ci: $CIRRUS_CI" +if [[ "$CIRRUS_CI" = false || -z $CIRRUS_CI ]] +then + echo "This script is aimed to be run on CI environments. Do not run locally." + exit 1 +fi if [[ -z $ENGINE_PATH ]] then - echo "This script is aimed to be run on CI environments. Do not run locally." + echo "Engine path should be set to run the script." exit 1 fi