Check shell scripts via bashate 61/56361/2
authorCédric Ollivier <cedric.ollivier@orange.com>
Tue, 24 Apr 2018 12:31:54 +0000 (14:31 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Tue, 24 Apr 2018 12:36:46 +0000 (14:36 +0200)
Change-Id: I33df0017945a32946c46bff0768624901e13f6f1
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
build.sh
test-requirements.txt
tox.ini

index c699b1e..7d78afe 100644 (file)
--- a/build.sh
+++ b/build.sh
@@ -17,11 +17,14 @@ build_opts=(--pull=true --no-cache --force-rm=true)
 
 for arch in ${arch};do
     if [[ ${arch} == arm64 ]]; then
-        find . -name Dockerfile -exec sed -i -e "s|alpine:3.7|multiarch/alpine:arm64-v3.7|g" {} +
+        find . -name Dockerfile -exec sed -i \
+            -e "s|alpine:3.7|multiarch/alpine:arm64-v3.7|g" {} +
     fi
-    (cd docker &&   docker build "${build_opts[@]}" -t "${repo}/${image}:${arch}-${tag}" .)
+    (cd docker &&   docker build "${build_opts[@]}" \
+        -t "${repo}/${image}:${arch}-${tag}" .)
     docker push "${repo}/${image}:${arch}-${tag}"
-    [ "$?" == "0" ] && (sudo docker rmi "${repo}/${image}:${arch}-${tag}"|| true)
+    [ "$?" == "0" ] &&
+        (sudo docker rmi "${repo}/${image}:${arch}-${tag}"|| true)
     find . -name Dockerfile -exec git checkout \{\} +;
 done
 exit $?
index baa806e..9fd3514 100644 (file)
@@ -10,3 +10,4 @@ sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
 sphinx-rtd-theme
 yamllint
 doc8>=0.6.0 # Apache-2.0
+bashate>=0.5.1 # Apache-2.0
diff --git a/tox.ini b/tox.ini
index 00a51bd..98d7140 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist = docs,pep8,pylint,yamllint,py35,py27,perm,cover
+envlist = docs,pep8,pylint,yamllint,bashate,py35,py27,perm,cover
 
 [testenv]
 usedevelop = True
@@ -43,6 +43,12 @@ commands =
 [testenv:py35]
 commands = nosetests xtesting/tests/unit
 
+[testenv:bashate]
+basepython = python2.7
+files =
+  build.sh
+commands = bashate {[testenv:bashate]files}
+
 [testenv:cover]
 basepython = python2.7
 dirs =