fastlane-plugin-docker 0.1.0 → 0.2.0.pre.alpha.pre.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60c8957f20aad91699ad8a502f843e2987ce348a
4
- data.tar.gz: 43e71b0f67766c0cf16653939de892024a1b4115
3
+ metadata.gz: ff01e1e8c5c3d6d5725051c197a02ddfeaa397a7
4
+ data.tar.gz: fb65409ec29fab67384c38d18f0c111f4118e955
5
5
  SHA512:
6
- metadata.gz: ffe0945f56633e6c5e30fd65f63ced4b51e3ace8f2ec5b317e0bc3068553d2347facaee2d6965fc879797e598667a26635db226afb3c602fcf92b902cb2f9199
7
- data.tar.gz: 91ef8aa5a89b045a1ef3a5b55c835e5a2242ebf23fca36cf9eec2f4d498bcd0fc4980ee469f8c607fe37c405545cb5b23559c2783727b55d23216356376f7cd3
6
+ metadata.gz: 475bbafed5bd59ace63475135da1d5eaf6efbe18c7d42e81eb33a5bed1ddc493da238445e54853050ad62499e5811c2aeea93e25020fad5c281694016f072092
7
+ data.tar.gz: 31e44ee4b388a88de2faaa499154a184153f78b902188ebcd28adb9435ae7dabe23677ccd75526bbf702958334eaf84d4a01ba4d515a4d5748aca022a6f425da
data/README.md CHANGED
@@ -16,7 +16,46 @@ Actions to support building images, logging into Docker Hub, and pushing those i
16
16
 
17
17
  ## Example
18
18
 
19
- Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, setting your Docker Hub username and password as environment variables by running `export DOCKER_LOGIN_USER="<your user name>"` and `export DOCKER_LOGIN_PASSWORD="<your password>"`, running `fastlane install_plugins` and `bundle exec fastlane test`.
19
+ Here is some sample code to get you started:
20
+
21
+ ```ruby
22
+
23
+ lane :release_docker_image do
24
+ ensure_docker_machine_available(
25
+ machine_name: "docker-build-machine"
26
+ )
27
+
28
+ docker_login
29
+
30
+ docker_build(
31
+ repository: "example-org/server",
32
+ tag: "1.2.0"
33
+ )
34
+
35
+ docker_push
36
+ end
37
+
38
+ ```
39
+ This will start using a docker machine (creating it if it doesn't exist yet), login to docker hub, build and tag a new docker image and push that image to Docker Hub.
40
+
41
+ ```ruby
42
+ lane :update_compose_deployment do
43
+ ensure_docker_machine_available(
44
+ machine_name: "docker-build-machine"
45
+ )
46
+ docker_compose(
47
+ command: "pull"
48
+ )
49
+ docker_compose(
50
+ command: "up"
51
+ )
52
+ end
53
+
54
+ ```
55
+
56
+ This will start using a docker machine (creating it if it doesn't exist yet), pull all images from `docker-compose.yml` and bring them up.
57
+
58
+ Alternatively, check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, setting your Docker Hub username and password as environment variables by running `export DOCKER_LOGIN_USER="<your user name>"` and `export DOCKER_LOGIN_PASSWORD="<your password>"`, running `fastlane install_plugins` and `bundle exec fastlane test`.
20
59
 
21
60
  Attention: If you don't change the example Fastfile at all, a new repository with `<your username>/test` will be pushed to Docker Hub!
22
61
 
@@ -0,0 +1,59 @@
1
+ module Fastlane
2
+ module Actions
3
+ class DockerComposeAction < Action
4
+ def self.run(params)
5
+ unless `which docker-compose`.include?("docker-compose")
6
+ UI.error("docker-compose was not found")
7
+ UI.error("please read the following https://docs.docker.com/compose/install/ on how to install it.")
8
+ UI.user_error!("docker-compose not installed")
9
+ end
10
+
11
+ command = "docker-compose "
12
+ command << params[:files].map { |item| " -f " + item }.join + " " if params[:files]
13
+ command << "--project-name {params[:project].shellescape} " if params[:project]
14
+ command << params[:command]
15
+ command << " -d " if params[:command] == "up" && params[:detach]
16
+
17
+ Actions.sh command, log: true
18
+ end
19
+
20
+ def self.description
21
+ "Define and run multi-container applications with Docker"
22
+ end
23
+
24
+ def self.available_options
25
+ [
26
+ FastlaneCore::ConfigItem.new(key: :files,
27
+ description: "Compose files",
28
+ env_name: "DOCKER_BUILD_COMPOSE_FILES",
29
+ is_string: false,
30
+ optional: true,
31
+ type: Array),
32
+ FastlaneCore::ConfigItem.new(key: :command,
33
+ description: "Compose command (up, down, pull ....)",
34
+ default_value: "log",
35
+ optional: false,
36
+ env_name: "DOCKER_COMPOSE_COMMAND"),
37
+ FastlaneCore::ConfigItem.new(key: :detach,
38
+ description: "Detach on run",
39
+ optional: true,
40
+ is_string: false,
41
+ default_value: true,
42
+ env_name: "DOCKER_COMPOSE_DETACH"),
43
+ FastlaneCore::ConfigItem.new(key: :project,
44
+ description: "Compose project name",
45
+ optional: true,
46
+ env_name: "DOCKER_COMPOSE_PROJECT")
47
+ ]
48
+ end
49
+
50
+ def self.authors
51
+ ["hjanuschka"]
52
+ end
53
+
54
+ def self.is_supported?(platform)
55
+ true
56
+ end
57
+ end
58
+ end
59
+ end
@@ -28,7 +28,7 @@ SCRIPT
28
28
  Actions.sh "docker-machine create -d virtualbox #{name.shellescape} 1> /dev/null"
29
29
  end
30
30
 
31
- def configure_env(machine_name)
31
+ def configure_env(machine_name)
32
32
  instructions = (Actions.sh "docker-machine env #{machine_name} --shell sh").lines
33
33
  instructions.map!(&:strip).select! { |i| i =~ /^export/ }
34
34
  instructions.each do |i|
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Docker
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-docker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0.pre.alpha.pre.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manu Wallner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-04 00:00:00.000000000 Z
11
+ date: 2017-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -105,13 +105,14 @@ files:
105
105
  - lib/fastlane/plugin/docker.rb
106
106
  - lib/fastlane/plugin/docker/actions/docker_build.rb
107
107
  - lib/fastlane/plugin/docker/actions/docker_client.rb
108
+ - lib/fastlane/plugin/docker/actions/docker_compose.rb
108
109
  - lib/fastlane/plugin/docker/actions/docker_login.rb
109
110
  - lib/fastlane/plugin/docker/actions/docker_machine_client.rb
110
111
  - lib/fastlane/plugin/docker/actions/docker_push.rb
111
112
  - lib/fastlane/plugin/docker/actions/ensure_docker_machine_available.rb
112
113
  - lib/fastlane/plugin/docker/helper/docker_helper.rb
113
114
  - lib/fastlane/plugin/docker/version.rb
114
- homepage: https://github.com/milch/fastlane-docker
115
+ homepage: https://github.com/milch/fastlane-plugin-docker
115
116
  licenses:
116
117
  - MIT
117
118
  metadata: {}
@@ -126,15 +127,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
127
  version: '0'
127
128
  required_rubygems_version: !ruby/object:Gem::Requirement
128
129
  requirements:
129
- - - ">="
130
+ - - ">"
130
131
  - !ruby/object:Gem::Version
131
- version: '0'
132
+ version: 1.3.1
132
133
  requirements: []
133
134
  rubyforge_project:
134
- rubygems_version: 2.5.1
135
+ rubygems_version: 2.4.8
135
136
  signing_key:
136
137
  specification_version: 4
137
138
  summary: fastlane Actions to support building images, logging into Docker Hub, and
138
139
  pushing those images to the Hub
139
140
  test_files: []
140
- has_rdoc: