Class: Stax::Docker
Instance Method Summary collapse
-
#build ⇒ Object
override this method with the desired builder.
- #exists ⇒ Object
- #image ⇒ Object
- #login ⇒ Object
- #poll ⇒ Object
- #push ⇒ Object
- #registry ⇒ Object
- #repository ⇒ Object
Instance Method Details
#build ⇒ Object
override this method with the desired builder
51 |
# File 'lib/stax/docker.rb', line 51 desc 'build', 'build docker image' |
#exists ⇒ Object
71 72 73 |
# File 'lib/stax/docker.rb', line 71 def exists puts Aws::Ecr.exists?(docker_repository, Git.sha) end |
#image ⇒ Object
46 47 48 |
# File 'lib/stax/docker.rb', line 46 def image puts docker_image end |
#login ⇒ Object
57 58 59 60 61 62 63 |
# File 'lib/stax/docker.rb', line 57 def login Aws::Ecr.auth.each do |auth| debug("Login to ECR registry #{auth.proxy_endpoint}") user, pass = Base64.decode64(auth.).split(':') system "docker login -u #{user} -p #{pass} #{auth.proxy_endpoint}" end end |
#poll ⇒ Object
76 77 78 79 |
# File 'lib/stax/docker.rb', line 76 def poll debug("Waiting for image in ECR #{docker_repository}:#{Git.sha}") sleep 10 until Aws::Ecr.exists?(docker_repository, Git.sha) end |
#push ⇒ Object
66 67 68 |
# File 'lib/stax/docker.rb', line 66 def push docker_push end |
#registry ⇒ Object
36 37 38 |
# File 'lib/stax/docker.rb', line 36 def registry puts docker_registry end |
#repository ⇒ Object
41 42 43 |
# File 'lib/stax/docker.rb', line 41 def repository puts docker_repository end |