Skip to content

Commit

Permalink
add shellcheck and fixes (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkarlsen authored Oct 19, 2021
1 parent 0406a1a commit 7b33067
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- uses: brpaz/[email protected]
- name: Run ShellCheck
uses: ludeeus/[email protected]
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
Expand Down
10 changes: 5 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@
set -e

#remove any stale socket file so that restarts do not fail
rm -f ${OVERMIND_SOCKET}
rm -f "${OVERMIND_SOCKET}"

# If GOSU_CHOWN environment variable set, recursively chown all specified directories
# to match the user:group set in GOSU_USER environment variable.
if [ -n "$GOSU_CHOWN" ]; then
for DIR in $GOSU_CHOWN
do
chown -R $GOSU_USER $DIR
chown -R "$GOSU_USER" "$DIR"
done
fi

if (( `id -u` == 0 )); then
if (( $(id -u) == 0 )); then
chown -R app:app /app || true
fi

# If GOSU_USER environment variable set to something other than 0:0 (root:root),
# become user:group set within and exec command passed in args
if [ -n "$GOSU_USER" ] && [ "$GOSU_USER" != "0:0" ]; then
IFS=':' read -r -a uidgid <<< $GOSU_USER
IFS=':' read -r -a uidgid <<< "$GOSU_USER"
groupmod -o -g "${uidgid[1]}" app || true
usermod -u "${uidgid[0]}" -g "${uidgid[1]}" app
exec gosu $GOSU_USER "$@"
exec gosu "$GOSU_USER" "$@"
fi

if [ -n "$OTEL_ENABLED" ]; then
Expand Down
2 changes: 1 addition & 1 deletion tag.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

git tag $(git branch --show-current)-$(date +%Y%m%d) -f
git tag "$(git branch --show-current)"-"$(date +%Y%m%d)" -f

0 comments on commit 7b33067

Please sign in to comment.