Created
April 30, 2015 18:49
-
-
Save brendanstennett/aad056f077c5b70880e7 to your computer and use it in GitHub Desktop.
Docker+Fig+Guard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
trap "kill 0" SIGINT SIGTERM EXIT | |
listen -f 0.0.0.0:4000 & | |
docker exec -it myproject_web_1 bundle exec guard -o 10.0.2.2:4000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guard :rspec, cmd: 'rspec' do | |
watch(%r{spec/(.+)_spec.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | |
watch(%r{lib/(.+).rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } | |
watch('spec/spec_helper.rb') { "spec" } | |
watch(%r{app/(.+).rb$}) { |m| "spec/#{m[1]}_spec.rb" } | |
watch(%r{app/(.*)(.erb|.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" } | |
watch(%r{app/controllers/(.+)_(controller).rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] } | |
watch(%r{spec/support/(.+).rb$}) { "spec" } | |
watch('config/routes.rb') { "spec/routing" } | |
watch('app/controllers/application_controller.rb') { "spec/controllers" } | |
end |
I got the host IP figured out (umm, not enough coffee that day I guess).
For newer versions of guard/listen you need to also pass -r on the listen command. And unfortunately in listen 2.10.0 I'm getting an error, which appears to be fixed on guard/listen master.
Here's what I ended up with: https://gist.github.com/thecatwasnot/9dde2e100ccad19660cf
Ubuntu 14.04 -> Vagrant(CoreOS) -> docker
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@HuffMoody Thanks for the update and pointers, I'm a lot closer than I was, and after some fiddling I thought I got it, it stopped complaining about not making a connection but no events seemed to arrive. How did you get the IP for the guard command? I'm not using boot2docker, but a CoreOS vagrant instance.