Class: Fastlane::Actions::DockerBuildAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/docker/actions/docker_build.rb

Class Method Summary collapse

Class Method Details

.authorsObject



50
51
52
# File 'lib/fastlane/plugin/docker/actions/docker_build.rb', line 50

def self.authors
  ["milch"]
end

.available_optionsObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/fastlane/plugin/docker/actions/docker_build.rb', line 22

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :repository,
                                 description: "The docker repository",
                                 env_name: "DOCKER_BUILD_REPOSITORY"),
    FastlaneCore::ConfigItem.new(key: :tag,
                                 description: "The tag for the new image",
                                 default_value: "latest",
                                 env_name: "DOCKER_BUILD_TAG"),
    FastlaneCore::ConfigItem.new(key: :path,
                                 description: "Path to the Dockerfile",
                                 default_value: ".",
                                 env_name: "DOCKER_BUILD_PATH")
  ]
end

.descriptionObject



18
19
20
# File 'lib/fastlane/plugin/docker/actions/docker_build.rb', line 18

def self.description
  "Build docker images in the current directory"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/fastlane/plugin/docker/actions/docker_build.rb', line 54

def self.is_supported?(platform)
  true
end

.outputObject



38
39
40
41
42
43
44
# File 'lib/fastlane/plugin/docker/actions/docker_build.rb', line 38

def self.output
  [
    ["DOCKER_BUILT_IMAGE", "The ID of the docker image that was built. Other docker actions pick this up automatically"],
    ["DOCKER_BUILT_REPO", "The Repository of the docker image that was built. Other docker actions pick this up automatically"],
    ["DOCKER_BUILT_TAG", "The Tag of the docker image that was built. Other docker actions pick this up automatically"]
  ]
end

.return_valueObject



46
47
48
# File 'lib/fastlane/plugin/docker/actions/docker_build.rb', line 46

def self.return_value
  "The ID of the created image"
end

.run(params) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/fastlane/plugin/docker/actions/docker_build.rb', line 10

def self.run(params)
  UI.message "Building docker image..."

  Actions.lane_context[SharedValues::DOCKER_BUILT_IMAGE] = DockerClient.new.build(params[:repository], params[:path], tag: params[:tag])
  Actions.lane_context[SharedValues::DOCKER_BUILT_REPO] = params[:repository]
  Actions.lane_context[SharedValues::DOCKER_BUILT_TAG] =  params[:tag]
end