mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2024-11-23 11:31:49 +01:00
update shellcheck
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
parent
55513d40f6
commit
7b5ef7166f
|
@ -5,7 +5,7 @@ set -o pipefail
|
||||||
ERRORS=()
|
ERRORS=()
|
||||||
|
|
||||||
# find all executables and run `shellcheck`
|
# find all executables and run `shellcheck`
|
||||||
for f in $(find . -type f -not -iwholename '*.git*' | sort -u); do
|
for f in $(find . -type f -not -iwholename '*.git*' -not -name "Dockerfile" | sort -u); do
|
||||||
if file "$f" | grep --quiet shell; then
|
if file "$f" | grep --quiet shell; then
|
||||||
{
|
{
|
||||||
shellcheck "$f" && echo "[OK]: sucessfully linted $f"
|
shellcheck "$f" && echo "[OK]: sucessfully linted $f"
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
set -e
|
set -e
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
: LDAP_ROOTPASS=${LDAP_ROOTPASS}
|
: LDAP_ROOTPASS="${LDAP_ROOTPASS}"
|
||||||
: LDAP_DOMAIN=${LDAP_DOMAIN}
|
: LDAP_DOMAIN="${LDAP_DOMAIN}"
|
||||||
: LDAP_ORGANIZATION=${LDAP_ORGANIZATION}
|
: LDAP_ORGANIZATION="${LDAP_ORGANIZATION}"
|
||||||
|
|
||||||
if [ ! -e /var/lib/ldap/docker_bootstrapped ]; then
|
if [ ! -e /var/lib/ldap/docker_bootstrapped ]; then
|
||||||
echo "configuring slapd for first run"
|
echo "configuring slapd for first run"
|
||||||
|
|
|
@ -5,17 +5,17 @@ set -o pipefail
|
||||||
COMMAND=/opt/sublime_text/sublime_text
|
COMMAND=/opt/sublime_text/sublime_text
|
||||||
|
|
||||||
if [ -z ${NEWUSER+x} ]; then
|
if [ -z ${NEWUSER+x} ]; then
|
||||||
echo 'WARN: No user was defined, defaulting to root.'
|
echo "WARN: No user was defined, defaulting to root."
|
||||||
echo 'WARN: Sublime will save files as root:root.'
|
echo "WARN: Sublime will save files as root:root."
|
||||||
echo ' To prevent this, start the container with -e NEWUSER=$USER'
|
echo " To prevent this, start the container with -e NEWUSER=\$USER"
|
||||||
exec $COMMAND -w
|
exec "$COMMAND" -w
|
||||||
else
|
else
|
||||||
# The root user already exists, so we only need to do something if
|
# The root user already exists, so we only need to do something if
|
||||||
# a user has been specified.
|
# a user has been specified.
|
||||||
useradd -s /bin/bash $NEWUSER
|
useradd -s /bin/bash "$NEWUSER"
|
||||||
# If you'd like to have Sublime Text add your development folder
|
# If you'd like to have Sublime Text add your development folder
|
||||||
# to the current project (i.e. in the sidebar at start), append
|
# to the current project (i.e. in the sidebar at start), append
|
||||||
# "-a /home/$NEWUSER/Documents" (without quotes) into the su -c command below.
|
# "-a /home/$NEWUSER/Documents" (without quotes) into the su -c command below.
|
||||||
# Example: su $NEWUSER -c "$COMMAND -w -a /home/$NEWUSER/Documents"
|
# Example: su $NEWUSER -c "$COMMAND -w -a /home/$NEWUSER/Documents"
|
||||||
su $NEWUSER -c "$COMMAND -w"
|
su "$NEWUSER" -c "$COMMAND -w"
|
||||||
fi
|
fi
|
||||||
|
|
3
test.sh
3
test.sh
|
@ -24,6 +24,7 @@ validate_diff() {
|
||||||
|
|
||||||
# get the dockerfiles changed
|
# get the dockerfiles changed
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
|
# shellcheck disable=SC2207
|
||||||
files=( $(validate_diff --name-only -- '*Dockerfile') )
|
files=( $(validate_diff --name-only -- '*Dockerfile') )
|
||||||
unset IFS
|
unset IFS
|
||||||
|
|
||||||
|
@ -44,7 +45,7 @@ for f in "${files[@]}"; do
|
||||||
|
|
||||||
(
|
(
|
||||||
set -x
|
set -x
|
||||||
docker build -t ${base}:${suite} ${build_dir}
|
docker build -t "${base}:${suite}" "${build_dir}"
|
||||||
)
|
)
|
||||||
|
|
||||||
echo " --- "
|
echo " --- "
|
||||||
|
|
Loading…
Reference in New Issue
Block a user