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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43d8e3a26481b9f73018fa8fd65f7a48ed5c3d42
|
4
|
+
data.tar.gz: 93134730cab48e41a76a4f37f45453ca0ae2f3dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6d9eb7a2ee2330eae82310d52e13bfe3b6813181d30957e2f09112cc5b56ab603182a63416652e234c40b7b75a1874c897a42682b5cbc575b409fc4a4d7a6a7
|
7
|
+
data.tar.gz: 8bfd5e819bc66eb45a7dec04924c85bada1d909f2545b52990648c759686de09f9b5a6de9a8fe855fb727af7268b1fd5a5ea15ffd673689a31827accd51a1bf6
|
data/lib/build/composer.rb
CHANGED
@@ -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>', @
|
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 ==
|
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
|
-
|
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
|
+
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-
|
11
|
+
date: 2015-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gcloud
|