Sha256: fa58a8f7cf6a90f5a6db40c0d171a22534152cd0396b2bf9e50391f2fa4c9faf

Contents?: true

Size: 1.3 KB

Versions: 13

Compression:

Stored size: 1.3 KB

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
ENV['PATH'] = "/opt/docker/:#{ENV['PATH']}" if ENV['CI'] == 'true'

require 'rake'
require 'docker'
require 'rspec/core/rake_task'
require 'cane/rake_task'


desc 'Run the full test suite from scratch'
task :default => [:unpack, :rspec, :quality]

RSpec::Core::RakeTask.new do |t|
  t.pattern = 'spec/**/*_spec.rb'
end

Cane::RakeTask.new(:quality) do |cane|
  cane.canefile = '.cane'
end

desc 'Download the necessary base images'
task :unpack do
  %w( swipely/base registry busybox tianon/true debian:wheezy ).each do |image|
    system "docker pull #{image}"
  end
end

desc 'Run spec tests with a registry'
task :rspec do
  begin
    registry = Docker::Container.create(
      'name' => 'registry',
      'Image' => 'registry',
      'Env' => ["GUNICORN_OPTS=[--preload]"],
      'ExposedPorts' => {
        '5000/tcp' => {}
      },
      'HostConfig' => {
        'PortBindings' => { '5000/tcp' => [{ 'HostPort' => '5000' }] }
      }
    )
    registry.start
    Rake::Task["spec"].invoke
  ensure
    registry.kill!.remove unless registry.nil?
  end
end

desc 'Pull an Ubuntu image'
image 'ubuntu:13.10' do
  puts "Pulling ubuntu:13.10"
  image = Docker::Image.create('fromImage' => 'ubuntu', 'tag' => '13.10')
  puts "Pulled ubuntu:13.10, image id: #{image.id}"
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
docker-api-1.31.0 Rakefile
docker-api-1.30.2 Rakefile
docker-api-1.30.1 Rakefile
docker-api-1.30.0 Rakefile
docker-api-1.29.2 Rakefile
docker-api-1.29.1 Rakefile
docker-api-1.29.0 Rakefile
docker-api-1.28.0 Rakefile
docker-api-1.27.0 Rakefile
docker-api-1.26.2 Rakefile
docker-api-1.26.1 Rakefile
docker-api-1.26.0 Rakefile
docker-api-1.25.0 Rakefile