shellcheck: clean up shellcheck warnings and enable
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ibc843b98c0fea97a31d3d15b556a32f091bf8e47
diff --git a/docs-build.sh b/docs-build.sh
index a98fd7c..b0f06f8 100755
--- a/docs-build.sh
+++ b/docs-build.sh
@@ -23,7 +23,7 @@
${PROXY}
-ENV DEBIAN_FRONTEND noninteractive
+ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -yy \
make \
texlive-xetex \
@@ -31,8 +31,8 @@
fonts-inconsolata \
fonts-linuxlibertine
-RUN grep -q ${GROUPS} /etc/group || groupadd -g ${GROUPS} ${USER}
-RUN grep -q ${UID} /etc/passwd || useradd -d ${HOME} -m -u ${UID} -g ${GROUPS} ${USER}
+RUN grep -q ${GROUPS[0]} /etc/group || groupadd -g ${GROUPS[0]} ${USER}
+RUN grep -q ${UID} /etc/passwd || useradd -d ${HOME} -m -u ${UID} -g ${GROUPS[0]} ${USER}
USER ${USER}
ENV HOME ${HOME}
@@ -41,8 +41,7 @@
)
# Build the docker container
-docker build -t linux-build/ubuntu - <<< "${Dockerfile}"
-if [[ "$?" -ne 0 ]]; then
+if ! docker build -t linux-build/ubuntu - <<< "${Dockerfile}" ; then
echo "Failed to build docker container."
exit 1
fi
@@ -52,7 +51,7 @@
export PROXY_HOST=${PROXY_HOST/%:[0-9]*}
export PROXY_PORT=${http_proxy/#http*:\/\/*:}
-mkdir -p ${WORKSPACE}
+mkdir -p "${WORKSPACE}"
cat > "${WORKSPACE}"/build.sh << EOF_SCRIPT
#!/bin/bash
@@ -68,8 +67,8 @@
EOF_SCRIPT
-chmod a+x ${WORKSPACE}/build.sh
+chmod a+x "${WORKSPACE}/build.sh"
# Run the docker container, execute the build script we just built
-docker run --cap-add=sys_admin --net=host --rm=true -e WORKSPACE=${WORKSPACE} --user="${USER}" \
- -w "${HOME}" -v "${HOME}":"${HOME}" -t linux-build/ubuntu ${WORKSPACE}/build.sh
+docker run --cap-add=sys_admin --net=host --rm=true -e WORKSPACE="${WORKSPACE}" --user="${USER}" \
+ -w "${HOME}" -v "${HOME}":"${HOME}" -t linux-build/ubuntu "${WORKSPACE}/build.sh"