Skip to content

Commit

Permalink
Implement runWithUser/fsGroup within entrypoint (runatlantis#1326)
Browse files Browse the repository at this point in the history
  • Loading branch information
raxod502-plaid authored and krrrr38 committed Dec 16, 2022
1 parent e8507b7 commit 5570cae
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ set -e

# Modified: https://github.com/hashicorp/docker-consul/blob/2c2873f9d619220d1eef0bc46ec78443f55a10b5/0.X/docker-entrypoint.sh

# https://github.com/runatlantis/helm-charts/issues/14
if [ -d /atlantis-data -a "$(stat -c %U:%G /atlantis-data 2>/dev/null)" != atlantis:atlantis ]; then
echo "docker-entrypoint.sh: detected /atlantis-data wrong filesystem permissions" >&2
echo "currently owned by $(stat -c %U:%G /atlantis-data 2>/dev/null), changing to atlantis:atlantis..." >&2
chown -R atlantis:atlantis /atlantis-data
echo "docker-entrypoint.sh: finished changing /atlantis-data filesystem permissions" >&2
fi

# If the user is trying to run atlantis directly with some arguments, then
# pass them to atlantis.
if [ "${1:0:1}" = '-' ]; then
Expand Down

0 comments on commit 5570cae

Please sign in to comment.