Sha256: 7c69fd8ae0930d0846558bf1ac4cb91a7310ebb2fc3d849cb39166e7d4e552a6

Contents?: true

Size: 1.29 KB

Versions: 3

Compression:

Stored size: 1.29 KB

Contents

def printimages
  puts %x[docker images | grep '^gild/gaptool']
end

unless File.exists?('/.dockerenv')
  namespace :docker do
    namespace :build do
      task :image do
        sys(%w(./scripts/build_docker_images.sh))
        printimages
      end

      task :all => [:image]
    end

    desc 'Build the docker image'
    task :build => 'build:image'

    desc "Push the release image to the Docker Hub"
    task :push => 'push:release'

    task :up => [:build, :recreate]

    desc "Run tests w/ docker"
    task :test => :build do
      sys(%w(fig run --rm gaptool rake test))
    end

    desc "Stop docker containers"
    task :stop do
      sys(%w(fig stop))
    end

    desc "Start docker containers"
    task :start do
      sys(%w(fig start))
    end

    desc "Restart docker containers"
    task :restart => [:stop, :start]

    desc "Stop and remove docker containers (alias 'rm')"
    task :remove => :stop do
      sys(%w(fig rm --force))
    end

    task :rm => :remove

    desc "Recreate docker containers without building"
    task :recreate do
      sys(%w(fig up -d))
    end

    desc "Run a command in the docker container"
    task :run do
      exit sys(%W(fig run --rm gaptool #{ARGV[1..-1].shelljoin}))
    end
  end

  desc "Bring up docker containers"
  task :docker => 'docker:up'
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gaptool-server-0.6.6 tasks/docker.rb
gaptool-server-0.6.4 tasks/docker.rb
gaptool-server-0.6.3 tasks/docker.rb