Skip to content

Commit

Permalink
Enable version checker to be run on cirrus (firebase#1778)
Browse files Browse the repository at this point in the history
* Enable version checker
  • Loading branch information
iskakaushik authored Jun 28, 2019
1 parent 66fe355 commit 6d33402
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion script/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ function error() {
echo "$@" 1>&2
}

function get_branch_base_sha() {
local branch_base_sha="$(git merge-base --fork-point FETCH_HEAD HEAD || git merge-base FETCH_HEAD HEAD)"
echo "$branch_base_sha"
}

function check_changed_packages() {
# Try get a merge base for the branch and calculate affected packages.
# We need this check because some CIs can do a single branch clones with a limited history of commits.
local packages
local branch_base_sha="$(git merge-base --fork-point FETCH_HEAD HEAD || git merge-base FETCH_HEAD HEAD)"
local branch_base_sha="$(get_branch_base_sha)"
if [[ "$?" == 0 ]]; then
echo "Checking for changed packages from $branch_base_sha"
IFS=$'\n' packages=( $(git diff --name-only "$branch_base_sha" HEAD | grep -o "packages/[^/]*" | sed -e "s/packages\///g" | sort | uniq) )
Expand Down
2 changes: 2 additions & 0 deletions script/incremental_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ else
echo "No changes detected in packages."
else
(cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" $PLUGIN_SHARDING)
echo "Running version check for changed packages"
(cd "$REPO_DIR" && pub global run flutter_plugin_tools version-check --base_sha="$(get_branch_base_sha)")
fi
fi

0 comments on commit 6d33402

Please sign in to comment.