1616
1717# The script runs all CI builds and checks in a Docker container.
1818# It accepts two positional arguments:
19- # 1. A workspace dir, the root of the git repo clone, or "pull" literal.
20- # In the latter case, CI container image is pulled from a registry.
21- # 2. An optional target branch for code style diffs. Defaults to "master" for
22- # push commits and overwritten with TRAVIS_BRANCH env var for pull requests
23- # when run on Travis CI.
19+ # 1. A workspace dir, the root of the git repo clone, to be mounted in the container.
20+ # 2. A git revision (see man gitrevisions) to compare against HEAD to filter out modified and new
21+ # files. Some scripts only run on that subset.
2422
2523set -e
2624set -x
@@ -29,28 +27,13 @@ CONTAINER_REPO=shiftcrypto/firmware_v2
2927CONTAINER_VERSION=$( cat .containerversion)
3028CONTAINER=$CONTAINER_REPO :${CONTAINER_VERSION}
3129
32- if [ " $1 " == " pull" ] ; then
33- docker pull " $CONTAINER "
34- exit 0
35- fi
36-
3730WORKSPACE_DIR=" $1 "
3831if [ -z " ${WORKSPACE_DIR} " ]; then
3932 echo " Workspace dir path is empty."
4033 exit 1
4134fi
4235
43- TARGET_BRANCH=" ${2:- master} "
44- if [ " ${TRAVIS} " == " true" ] && [ " ${TRAVIS_PULL_REQUEST} " != " false" ] ; then
45- TARGET_BRANCH=${TRAVIS_BRANCH}
46- fi
47-
48- # Fetch origin/master so that we can diff when checking coding style.
49- git remote set-branches --add origin ${TARGET_BRANCH}
50- git fetch origin
51-
52- TARGET_BRANCH=origin/${TARGET_BRANCH}
53-
36+ TARGET_BRANCH=" $2 "
5437# The safe.directory config is so that git commands work. even though the repo folder mounted in
5538# Docker is owned by root, which can be different from the owner on the host.
5639docker run -e TARGET_BRANCH=" ${TARGET_BRANCH} " \
0 commit comments