mirror of
https://github.com/inspec/inspec
synced 2024-11-22 12:43:07 +00:00
c93d61da1c
Unfortunately, we have a lot of failing tests when we run as a non-root user and the files are owned by root. We can't chmod the checkout to the non-root user as it is a shared mount in docker and that's not allowed to the outside world. Signed-off-by: Ryan Davis <zenspider@chef.io>
28 lines
631 B
Bash
Executable file
28 lines
631 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -ueo pipefail
|
|
|
|
export LANG=C.UTF-8 LANGUAGE=C.UTF-8
|
|
apt-get update -y
|
|
apt-get install sudo -y
|
|
|
|
echo "--- setting up user"
|
|
useradd -m -U --uid 2000 normal
|
|
echo "normal ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/normal
|
|
|
|
echo "--- updating rubygems"
|
|
gem update --system -N
|
|
|
|
echo "--- system details"
|
|
uname -a
|
|
gem env
|
|
bundle --version
|
|
|
|
echo "--- bundle install"
|
|
bundle install --jobs=7 --retry=3 --without tools maintenance deploy
|
|
|
|
echo "+++ bundle exec rake"
|
|
# TODO: run this as non-root:
|
|
# chown -R normal:normal /home/normal /workdir
|
|
# su normal -c "bundle exec rake ${RAKE_TASK:-}"
|
|
bundle exec rake ${RAKE_TASK:-}
|