inspec/.expeditor/buildkite/verify.sh
Ryan Davis c93d61da1c Add a non-root user for testing on BK.
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>
2019-10-22 17:40:41 -07:00

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:-}