Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ download/prepare services. These are available keys.
|`services:<name>` |Hash |Yes |-|The service name e.g. `rails`, `db`, `redis`|
|`services:<name>:repo: <value>` |String |No |-|The git URL of the repository|
|`services:<name>:<key>: <value>` |Hash |No |-|The key and value of the environment variable. e.g. `POSTGRES_PASSWORD: abcdef`. |
|`image:` |String |No |-|The docker image. Only effective when `type` is `docker` or `cloud`|
|`image:` |Hash or String |No |-|The docker image|
|`image:base:` |String |No |-|The base image name|
|`image:install:` |Array<String> |No |-|The installed application on the image|
|`groups:` |Hash |No |-|The groups of the services|
|`groups:<name>: <service-names>` |Hash |No |-|The name of the group and the service names|
|`application:` |String |No |-|The name of the application that consists of the services|
Expand Down
12 changes: 10 additions & 2 deletions lib/devkitkat/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,16 @@ def environment_type
end
end

def image
devkitkat_yml.fetch('image', DEFAULT_IMAGE)
def image_base
if devkitkat_yml['image'].is_a?(String)
devkitkat_yml['image']
elsif devkitkat_yml['image'].is_a?(Hash)
devkitkat_yml.dig('image', 'base')
end || DEFAULT_IMAGE
end

def image_install
devkitkat_yml.dig('image', 'install') || []
end

def application
Expand Down
5 changes: 3 additions & 2 deletions lib/devkitkat/executor/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
module Devkitkat
class Executor
class Docker
attr_reader :service, :script_file
attr_reader :service, :script_file, :image

delegate :config, :command, to: :service

def initialize(service)
@service = service
@image = Image.new(config.image_base, config.image_install)
end

def prepare
Expand Down Expand Up @@ -49,7 +50,7 @@ def log_path_in_container
end

def docker_image
config.image
image.name
end

def container
Expand Down
37 changes: 37 additions & 0 deletions lib/devkitkat/image.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module Devkitkat
class Image
IMAGE_PREFIX = 'devkitkat'

attr_reader :base, :install

def initialize(base, install)
@base, @install = base, install
end

def name
# "#{IMAGE_PREFIX}-#{base_image}:#{install_checksum}"
base
end

def regstry_url
'dockerhub'
end

def build
# TODO:
end

def push
# TODO:
end

private

def install_checksum
end

def base_image
config.image
end
end
end
7 changes: 7 additions & 0 deletions lib/devkitkat/installs/ruby.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Devkitkat
module Installs
class Ruby

end
end
end