Class: Stax::Docker

Inherits:
Base
  • Object
show all
Defined in:
lib/stax/docker.rb

Instance Method Summary collapse

Instance Method Details

#buildObject

override this method with the desired builder



74
# File 'lib/stax/docker.rb', line 74

desc 'build', 'build docker image'

#existsObject



95
96
97
# File 'lib/stax/docker.rb', line 95

def exists
  puts Aws::Ecr.exists?(docker_repository, Git.sha)
end

#imageObject



69
70
71
# File 'lib/stax/docker.rb', line 69

def image
  puts docker_image
end

#loginObject



81
82
83
84
85
86
87
# File 'lib/stax/docker.rb', line 81

def 
  Aws::Ecr.auth.each do |auth|
    debug("Login to ECR registry #{auth.proxy_endpoint}")
    user, pass = Base64.decode64(auth.authorization_token).split(':')
    system "docker login -u #{user} -p #{pass} #{auth.proxy_endpoint}"
  end
end

#pollObject



100
101
102
103
# File 'lib/stax/docker.rb', line 100

def poll
  debug("Waiting for image in ECR #{docker_repository}:#{Git.sha}")
  sleep 10 until Aws::Ecr.exists?(docker_repository, Git.sha)
end

#pushObject



90
91
92
# File 'lib/stax/docker.rb', line 90

def push
  docker_push
end

#registryObject



59
60
61
# File 'lib/stax/docker.rb', line 59

def registry
  puts docker_registry
end

#repositoryObject



64
65
66
# File 'lib/stax/docker.rb', line 64

def repository
  puts docker_repository
end