summaryrefslogtreecommitdiff
path: root/scripts/environment.js
Commit message (Collapse)AuthorAgeFilesLines
* [build] Look further back for branch merge baseJason Wray2019-08-131-1/+1
|
* Handle >2 branches by switching to split[0]Jason Wray2018-08-071-1/+1
|
* [build] Fix CI failure when master and release branch are identicalJason Wray2018-08-071-1/+1
| | | | The search for branches containing the previous hash could return multiple matches on different lines, if, for instance, a newly-cut release branch were identical to master.
* [build] Attempt to determine a likely base branch without a PRJohn Firebaugh2018-07-231-0/+11
| | | | Walk backward through the history (maximum of 10 commits) until finding a commit on either master or release-*; assume that's the base branch.
* [build] Improve ccache freshnessJohn Firebaugh2018-07-131-0/+24
Save a fresh ccache on every build by including (a checksum of) the current revision in the cache key. In the worst case, saving the cache appears to take ~1:30 for android-release; other builds appear to take a small amount of time compared to the time saved by having a fresh cache, versus a cache that's up to a week old. Restore caches in the following priority order (all scoped to current architecture and job): 1. The cache for the current branch and revision. 2. If that doesn't exist, the most recent cache for the current branch. 3. If that doesn't exist, the cache for the parent branch and merge base, where "parent branch" means the base branch of the pull request specified by $CIRCLE_PULL_REQUEST (obtained from the GitHub API), and "merge base" means the revision returned by `git merge-base` when given the parent branch and $CIRCLE_BRANCH (obtained by executing that shell command). The intent here is to start a newly created branch off with the most relevant cache from its parent branch. 4. If that doesn't exist, the most recent cache for the parent branch. 5. If that doesn't exist, the most recent cache for master. 6. If that doesn't exist, use the most recent cache for any build. We cannot use the branch names or revisions themselves as key segments, because CircleCI lacks a way to interpolate arbitrary environment variables into the cache key name. Instead, we write the desired value into a file and use the `{{ checksum "filename" }}` syntax.