docker-publish 0.0.4 → 0.0.5

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: 5ce2a072bff9735facd862aa2c0a5f8e0ef1d882
4
- data.tar.gz: a66d70953acc5585d322dd5a80c615f4c6c4b18c
3
+ metadata.gz: 43d8e3a26481b9f73018fa8fd65f7a48ed5c3d42
4
+ data.tar.gz: 93134730cab48e41a76a4f37f45453ca0ae2f3dc
5
5
  SHA512:
6
- metadata.gz: d37acb77c4b7a397b20bd1dc63fe714ec8d86d3a8a0244bceded3eced4481369edfc9dd1ba495e3a468ae6bcf69712665cf6669afee53340755d390ec11d5b55
7
- data.tar.gz: 9315c38f0a0269f5aa3ac8e0bfb2285f25b4b55422e188af1192eb739f36c687a8be740334c0ee04c2f794491e226ff742aeb9d07070654403bd4e6c76a63f0a
6
+ metadata.gz: c6d9eb7a2ee2330eae82310d52e13bfe3b6813181d30957e2f09112cc5b56ab603182a63416652e234c40b7b75a1874c897a42682b5cbc575b409fc4a4d7a6a7
7
+ data.tar.gz: 8bfd5e819bc66eb45a7dec04924c85bada1d909f2545b52990648c759686de09f9b5a6de9a8fe855fb727af7268b1fd5a5ea15ffd673689a31827accd51a1bf6
@@ -38,6 +38,7 @@ class Composer
38
38
  docker_command
39
39
  end
40
40
 
41
+ public
41
42
  # @param [hash] args
42
43
  # @return [hash]
43
44
  def convert_env_args_to_env_hash(args)
@@ -43,7 +43,7 @@ class GoogleCloudPlatform
43
43
  dist_file_path = File.join(File.dirname(__FILE__), 'startup.sh.dist')
44
44
  dist = File.read(dist_file_path)
45
45
 
46
- dist = dist.gsub('<bucket_name>', @app_name)
46
+ dist = dist.gsub('<bucket_name>', @google_cloud_storage.get_bucket_name)
47
47
  dist = dist.gsub('<app_name>', @app_name)
48
48
  dist = dist.gsub('<primary_yaml>', get_compose_filename('primary', true))
49
49
  dist = dist.gsub('<backup_yaml>', get_compose_filename('backup', true))
@@ -68,6 +68,13 @@ class GoogleCloudPlatform
68
68
  @google_cloud_compute
69
69
  end
70
70
 
71
+ def push_container_to_registry(tag)
72
+ command = "gcloud docker push #{tag}"
73
+ puts command
74
+ system command
75
+ tag
76
+ end
77
+
71
78
  end
72
79
 
73
80
  require 'infrastructure/google_cloud_platform/google_cloud_storage'
@@ -9,21 +9,28 @@ class GoogleCloudStorage
9
9
  @credentials = credentials_path
10
10
 
11
11
  @storage = Gcloud.storage @project_name, @credentials
12
-
13
12
  @bucket = get_bucket
14
13
  end
15
14
 
15
+ def get_bucket_name
16
+ "#{@project_name}_#{@app_name}"
17
+ end
18
+
16
19
  private
17
20
  # @return [Bucket]
18
21
  def get_bucket
19
22
  buckets = @storage.buckets
23
+ bucket_names = []
20
24
  buckets.each do |bucket|
21
- if bucket.name == @app_name
25
+ if bucket.name == get_bucket_name
22
26
  return bucket
23
27
  end
28
+ bucket_names.push(bucket.name)
24
29
  end
25
30
 
26
- @storage.create_bucket @app_name, retries: 3
31
+ puts bucket_names
32
+
33
+ @storage.create_bucket get_bucket_name, retries: 3
27
34
  end
28
35
 
29
36
  public
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-publish
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - VJ Patel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-20 00:00:00.000000000 Z
11
+ date: 2015-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gcloud