ソースを参照

Fix warnings when running the specs using the test image

Setting $HOME to a writable directory fixes:

    `/` is not writable.
    Bundler will use `/tmp/bundler/home/unknown' as your home directory
    temporarily.

Unsetting `no_proxy` removes faraday warnings about `no_proxy` not
being supported.
Dominik Sander 7 年 前
コミット
9bdf27b916
3 ファイル変更3 行追加2 行削除
  1. 1 1
      docker/scripts/setup_env
  2. 0 1
      docker/test/Dockerfile
  3. 2 0
      docker/test/scripts/test_env

+ 1 - 1
docker/scripts/setup_env

@@ -5,8 +5,8 @@ export LC_ALL=en_US.UTF-8
 
 cd /app
 
+export HOME=/app
 if ! whoami &> /dev/null; then
-    export HOME=/app
     if [ -w /etc/passwd ]; then
         echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd
     fi

+ 0 - 1
docker/test/Dockerfile

@@ -19,7 +19,6 @@ RUN apt-get update && \
     curl -Ls https://bitbucket.org/ariya/phantomjs/downloads/${PHANTOM_JS}.tar.bz2 \
       | tar jxvf - --strip-components=2 -C /usr/local/bin/ ${PHANTOM_JS}/bin/phantomjs
 
-ENV RAILS_ENV test
 RUN LC_ALL=en_US.UTF-8 ON_HEROKU=true bundle install --with test development --path vendor/bundle -j 4
 
 COPY docker/test/scripts/test_env /scripts/

+ 2 - 0
docker/test/scripts/test_env

@@ -5,6 +5,8 @@ set -e
 source /app/.env
 
 export RAILS_ENV=test
+unset no_proxy
+
 bundle install --with test development --path vendor/bundle -j 4
 bundle exec rake db:create db:migrate
 bundle exec "$@"