From a17c6752fd387bd4f950f7e868f529d1ff817dc3 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Mon, 19 Feb 2018 02:06:23 +0100 Subject: [PATCH] Add Docker Config file for travis --- .travis.yml | 3 ++- config/docker.yml.erb.travis | 40 ++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 config/docker.yml.erb.travis diff --git a/.travis.yml b/.travis.yml index ac298285..56c06384 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ before_install: # Config to run docker tests - doesn't work so far # - sudo apt-get update # - sudo apt-get upgrade lxc-docker - - echo 'DOCKER_OPTS="-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock --iptables=false"' | sudo tee /etc/default/docker > /dev/null + - echo 'DOCKER_OPTS="-H tcp://127.0.0.1:2376 -H unix:///var/run/docker.sock --iptables=false"' | sudo tee /etc/default/docker > /dev/null # - export DOCKER_HOST=tcp://192.168.23.75:2375 - sudo service docker restart - sleep 5 @@ -27,6 +27,7 @@ before_script: - cp config/code_ocean.yml.travis config/code_ocean.yml - cp config/database.yml.travis config/database.yml - cp config/secrets.yml.travis config/secrets.yml + - cp config/docker.yml.erb.travis config/docker.yml.erb - psql --command='CREATE DATABASE travis_ci_test;' --username=postgres - bundle exec rake db:schema:load RAILS_ENV=test diff --git a/config/docker.yml.erb.travis b/config/docker.yml.erb.travis new file mode 100644 index 00000000..9f55d126 --- /dev/null +++ b/config/docker.yml.erb.travis @@ -0,0 +1,40 @@ +#Why erb? +default: &default + connection_timeout: 3 + pool: + active: false + ports: !ruby/range 4500..4600 + +development: + <<: *default + host: tcp://127.0.0.1:2376 + ws_host: ws://127.0.0.1:2376 #url to connect rails server to docker host + ws_client_protocol: ws:// #set the websocket protocol to be used by the client to connect to the rails server (ws on development, wss on production) + workspace_root: <%= Rails.root.join('tmp', 'files', Rails.env) %> + pool: + active: true + refill: + async: false + batch_size: 8 + interval: 15 + timeout: 60 + #workspace_root: <%= File.join('/', 'shared', Rails.env) %> + +production: + <<: *default + host: unix:///var/run/docker.sock + pool: + active: true + refill: + async: false + batch_size: 8 + interval: 15 + timeout: 60 + workspace_root: <%= Rails.root.join('tmp', 'files', Rails.env) %> + ws_host: ws://localhost:4243 #url to connect rails server to docker host + ws_client_protocol: wss:// #set the websocket protocol to be used by the client to connect to the rails server (ws on development, wss on production) + +test: + <<: *default + host: tcp://192.168.59.104:2376 + workspace_root: <%= File.join('/', 'shared', Rails.env) %>