diff --git a/.dockerignore b/.dockerignore index f827cb2849..4de9b1d477 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,5 @@ public/system publiclab.org log .git +*.log +tmp diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8507240ab7..df11e34fee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,12 +15,20 @@ before_script: - apk add --no-cache py-pip && pip install docker-compose - docker-compose build - docker-compose up -d - - docker-compose exec -T web bundle install - docker-compose exec -T web rake db:setup - docker-compose exec -T web rake db:migrate - docker-compose exec -T web bower install --allow-root job: script: - - docker-compose exec -T web rake test:all - - docker-compose exec -T web rails test -d + - docker-compose exec -T web strace -s 512 -o log/trace1.log rake test:all + - tail -n 3000 log/trace1.log > log/trace1.tail.log + - docker-compose exec -T web strace -s 512 -o log/trace2.log rails test -d + - tail -n 3000 log/trace2.log > log/trace2.tail.log + artifacts: + when: on_failure + paths: + - log/trace1.log + - log/trace1.tail.log + - log/trace2.log + - log/trace2.tail.log diff --git a/.travis.yml b/.travis.yml index e367dfb466..ba0a0c7683 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,9 +6,6 @@ services: env: - COMPOSE_FILE=./containers/docker-compose-testing.yml -before_script: - - bundle install - before_install: - echo -e "repo_token:\n $COVERALLS_REPO_TOKEN" >> ./.coveralls.yml diff --git a/Dockerfile b/Dockerfile index 5969a5bcc0..a333b324a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # Dockerfile # Plots2 # https://github.com/publiclab/plots2 -FROM ruby:2.4.1-stretch +FROM ruby:2.4.4-stretch LABEL description="This image deploys Plots2." @@ -18,7 +18,7 @@ ENV PHANTOMJS_VERSION 2.1.1 # Install dependencies RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - -RUN apt-get update -qq && apt-get install -y build-essential bundler libmariadbclient-dev ruby-rmagick libfreeimage3 wget curl procps cron make nodejs +RUN apt-get update -qq && apt-get install -y build-essential bundler libmariadbclient-dev ruby-rmagick libfreeimage3 wget curl procps cron make nodejs strace RUN wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -O /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2; tar -xvf /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C /opt ; cp /opt/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin/* /usr/local/bin/ RUN npm install -g bower diff --git a/Gemfile b/Gemfile index b7e7648569..bc913763af 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source 'https://rubygems.org' -ruby '2.4.1' +ruby '2.4.4' git_source(:github) do |repo_name| repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") diff --git a/Makefile b/Makefile index 2ea428dfdc..3a0d724f81 100644 --- a/Makefile +++ b/Makefile @@ -36,10 +36,8 @@ deploy-container: test-container: docker-compose up -d - docker-compose exec -T web bundle install docker-compose exec -T web rake db:setup docker-compose exec -T web rake db:migrate - docker-compose exec -T web bower install --allow-root docker-compose exec -T web rake test:all docker-compose exec -T web rails test -d docker-compose down diff --git a/containers/docker-compose-production.yml b/containers/docker-compose-production.yml index 43059b593b..4185519efb 100644 --- a/containers/docker-compose-production.yml +++ b/containers/docker-compose-production.yml @@ -47,8 +47,6 @@ services: restart: on-failure:5 redis: image: redis:latest - ports: - - '127.0.0.1:6379:6379' command: redis-server sidekiq: build: .. diff --git a/containers/docker-compose-stable.yml b/containers/docker-compose-stable.yml index c0211275b6..30316e9b38 100644 --- a/containers/docker-compose-stable.yml +++ b/containers/docker-compose-stable.yml @@ -47,8 +47,6 @@ services: restart: on-failure:5 redis: image: redis:latest - ports: - - '127.0.0.1:6379:6379' command: redis-server sidekiq: build: .. diff --git a/containers/docker-compose-testing.yml b/containers/docker-compose-testing.yml index ad1d69665b..8f0b947fb3 100644 --- a/containers/docker-compose-testing.yml +++ b/containers/docker-compose-testing.yml @@ -18,12 +18,12 @@ services: # if you want to re-import simply put away ../../mysql/* redis: image: redis:latest - ports: - - '6379:6379' command: redis-server web: build: .. - command: /bin/bash -c "sleep 5 && passenger start -p 4000" + cap_add: + - SYS_PTRACE + command: /bin/bash -c "sleep 5 && /usr/local/bundle/bin/passenger start --max-pool-size 9 --min-instances 9 -p 4000" environment: - RAILS_ENV=${RAILS_ENV} - SECRET_KEY_BASE=${SECRET_KEY_BASE} @@ -32,8 +32,6 @@ services: - redis volumes: - ..:/app - ports: - - "127.0.0.1:4000:4000" restart: unless-stopped sidekiq: build: .. diff --git a/containers/docker-compose-unstable.yml b/containers/docker-compose-unstable.yml index 57cd5fd4f6..618a3d8231 100644 --- a/containers/docker-compose-unstable.yml +++ b/containers/docker-compose-unstable.yml @@ -47,8 +47,6 @@ services: restart: on-failure:5 redis: image: redis:latest - ports: - - '127.0.0.1:6379:6379' command: redis-server sidekiq: build: ..