fastlane-plugin-docker 0.1.0.pre.alpha.pre.3 → 0.1.0.pre.alpha.pre.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d70f2096fa94924d5274c2481521d9c4ff0beb86
4
- data.tar.gz: 6dd9b5aeea62edcc34f88c89e553e822d30bb360
3
+ metadata.gz: ab8a5a62831a7820c642005389fa615c60201f1a
4
+ data.tar.gz: e73983742e2c4dead47dc0a7a7266253a2dc6b44
5
5
  SHA512:
6
- metadata.gz: cc3fc28924fb47bee47b9c85a8ef7d6bfaf167ae31912388bb9917ea266eb405a94f21f86f3d4f3c475b623cc33fc93634a7ad94de4466a746c385ee838df57f
7
- data.tar.gz: bd5f36a15dcd6907fa7b1a29ecf348baecdfc4c98a1b4f763738892a8e98605a060bd4d2183b224d900541109dfbf7210cdf73c29c16dd902467641ac79c1bec
6
+ metadata.gz: b1e6853561f07e39ed4d509b9f95fecae969f1fd1bf9ae649df9a5cd61ec44ab0acac5820b75c4f195dc9b38e4087c6d71a8fe00475c09af68267b4559f00959
7
+ data.tar.gz: 13f4793e8273aacb8918a60e3a66c5512be3350de678154d21bc7c99609f5ddc194078a403b8c828d74a732bcdd6bd7a79b7d538fa4518e84871e7aeb762f4cb
data/README.md CHANGED
@@ -36,9 +36,25 @@ lane :release_docker_image do
36
36
  end
37
37
 
38
38
  ```
39
-
40
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.
41
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
+
42
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`.
43
59
 
44
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!
@@ -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
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.pre.alpha.pre.3
4
+ version: 0.1.0.pre.alpha.pre.7
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-11 00:00:00.000000000 Z
11
+ date: 2016-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -105,6 +105,7 @@ 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