Class: Escualo::Script::Dockerized
Instance Attribute Summary collapse
-
#dockerfile ⇒ Object
Returns the value of attribute dockerfile.
Instance Method Summary collapse
- #base_image(options) ⇒ Object
- #escualo_install(options) ⇒ Object
- #finish! ⇒ Object
- #run_command!(command, ssh, options) ⇒ Object
- #start!(options) ⇒ Object
Methods inherited from Mode
Instance Attribute Details
#dockerfile ⇒ Object
Returns the value of attribute dockerfile.
39 40 41 |
# File 'lib/escualo/script.rb', line 39 def dockerfile @dockerfile end |
Instance Method Details
#base_image(options) ⇒ Object
59 60 61 62 63 64 65 66 67 |
# File 'lib/escualo/script.rb', line 59 def base_image() if .base_image == 'ubuntu' 'ubuntu:xenial' elsif .base_image == 'debian' 'debian:jessie' else raise "Unsupported base image #{.base_image}. Only debian and ubuntu are supported" end end |
#escualo_install(options) ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'lib/escualo/script.rb', line 49 def escualo_install() if .development " COPY escualo-#{Escualo::VERSION}.gem escualo-#{Escualo::VERSION}.gem RUN gem install escualo-#{Escualo::VERSION}.gem\n" else "RUN gem install escualo -v #{Escualo::VERSION}\n" end end |
#finish! ⇒ Object
73 74 75 |
# File 'lib/escualo/script.rb', line 73 def finish! File.write('Dockerfile', @dockerfile) end |
#run_command!(command, ssh, options) ⇒ Object
69 70 71 |
# File 'lib/escualo/script.rb', line 69 def run_command!(command, ssh, ) @dockerfile << "RUN #{command}\n" end |
#start!(options) ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/escualo/script.rb', line 41 def start!() @dockerfile = " FROM #{base_image } MAINTAINER #{ENV['USER']} RUN apt-get update && apt-get install ruby ruby-dev build-essential -y #{escualo_install }" end |