Created
July 31, 2014 06:20
-
-
Save shicholas/492b54d4a083a1c576af to your computer and use it in GitHub Desktop.
Dockerized Feature specs
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
begin | |
# build Docker image | |
`docker build -t app .` | |
# | |
# # delete old docker containers | |
`docker rm (docker ps -a -q)` | |
# gather all the feature specs | |
RAILS_ROOT = File.expand_path('../..', __FILE__) | |
feature_specs = Dir[File.join(RAILS_ROOT, 'spec/features/**/*.rb')] | |
# run a feature spec in a daemonized container | |
feature_specs.each do |feature_test| | |
filename = File.basename(feature_test, ".rb") | |
`docker run -d --name=#{filename} app phantomjs & bundle exec #{feature_test}` | |
end | |
rescue Exception => e | |
puts "OH NO YOU DID SOMETHING HORRIBLY WRONG" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment