16
16
17
17
# The script runs all CI builds and checks in a Docker container.
18
18
# 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.
24
22
25
23
set -e
26
24
set -x
@@ -29,28 +27,13 @@ CONTAINER_REPO=shiftcrypto/firmware_v2
29
27
CONTAINER_VERSION=$( cat .containerversion)
30
28
CONTAINER=$CONTAINER_REPO :${CONTAINER_VERSION}
31
29
32
- if [ " $1 " == " pull" ] ; then
33
- docker pull " $CONTAINER "
34
- exit 0
35
- fi
36
-
37
30
WORKSPACE_DIR=" $1 "
38
31
if [ -z " ${WORKSPACE_DIR} " ]; then
39
32
echo " Workspace dir path is empty."
40
33
exit 1
41
34
fi
42
35
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 "
54
37
# The safe.directory config is so that git commands work. even though the repo folder mounted in
55
38
# Docker is owned by root, which can be different from the owner on the host.
56
39
docker run -e TARGET_BRANCH=" ${TARGET_BRANCH} " \
0 commit comments