docker: source checking container
authorAnthony Romano <anthony.romano@coreos.com>
Wed, 19 Jul 2017 04:44:49 +0000 (21:44 -0700)
committerNIIBE Yutaka <gniibe@fsij.org>
Thu, 20 Jul 2017 03:24:44 +0000 (12:24 +0900)
Includes shellcheck and scan-build

Signed-off-by: Anthony Romano <anthony.romano@coreos.com>
docker/Dockerfile.check [new file with mode: 0644]
docker/Makefile

diff --git a/docker/Dockerfile.check b/docker/Dockerfile.check
new file mode 100644 (file)
index 0000000..5ee7acf
--- /dev/null
@@ -0,0 +1,7 @@
+FROM gnuk:latest
+
+LABEL Description="Image for checking gnuK"
+
+RUN apt install -y shellcheck
+RUN apt install -y clang libfindbin-libs-perl
+RUN apt clean
index 41dff4d..0924902 100644 (file)
@@ -5,9 +5,21 @@ endif
 all: ../chopstx docker-build-release
        docker run --user=`id -u` --env GNUK_CONFIG --rm -v `pwd`/..:/gnuk/ -t gnuk:latest
 
+clean: docker-build-release
+       docker run --user=`id -u` --env GNUK_CONFIG --rm -v `pwd`/..:/gnuk/ -w /gnuk/src -t gnuk:latest make clean
+
 gdb: docker-build-debug
        docker run --net host  --rm -i -v `pwd`/..:/gnuk/ -t gnuk:latest-debug arm-none-eabi-gdb /gnuk/src/build/gnuk.elf
 
+shellcheck: docker-build-check
+       docker run --rm -v `pwd`/..:/gnuk/ -t gnuk:latest-check shellcheck /gnuk/src/configure
+
+CHECKERS=security optin nullability core deadcode alpha.core alpha.security
+scan-build: clean docker-build-check
+       docker run --user=`id -u` --rm -v `pwd`/..:/gnuk/ -w /gnuk/src -t gnuk:latest-check scan-build -o scan-build \
+               -analyze-headers -stats $(addprefix -enable-checker ,$(CHECKERS)) -k \
+               --use-cc=arm-none-eabi-gcc \
+               make
 ../chopstx:
        git submodule update --init
 
@@ -17,4 +29,8 @@ docker-build-release:
 docker-build-debug: docker-build-release
        docker build -t gnuk:latest-debug -f `pwd`/Dockerfile.debug ..
 
-.PHONY: all gdb debug docker-build docker-build-releaes docker-build-debug
+docker-build-check: docker-build-release
+       docker build -t gnuk:latest-check -f `pwd`/Dockerfile.check ..
+
+.PHONY: all clean gdb shellcheck scan-build \
+       docker-build-release docker-build-debug docker-build-check