itamae-plugin-recipe-omori_gohan 0.0.1.beta2 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/itamae/plugin/recipe/omori_gohan/version.rb +1 -1
- data/wercker.yml +0 -4
- metadata +4 -5
- data/ci/destroy_old_droplets.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40300742276c4da5da2add0c25e097e4eabf1a88
|
4
|
+
data.tar.gz: c77dc84aaa8b64e2cdc7beb95bfb1f82d5d98d77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3ed1a25ea8db76cf251a91b405fef87bfb8eff7c90143ecb613dc60d0929793472a71235695c6fabafdf16ae5b98d9c59d0c37339da7ae4d1f3f6299ae78291
|
7
|
+
data.tar.gz: 38a9398f9a7f3ef7e6fd3797c2a653c9b664e1ea3fd1ddd685da91182f985af834309b163a09b8c1f5ad1e2aaef1836c03246fb7cca7b3dc6fafb0c810df0189
|
data/wercker.yml
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itamae-plugin-recipe-omori_gohan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: itamae
|
@@ -98,7 +98,6 @@ files:
|
|
98
98
|
- bin/console
|
99
99
|
- bin/setup
|
100
100
|
- ci/build.sh
|
101
|
-
- ci/destroy_old_droplets.rb
|
102
101
|
- itamae-plugin-recipe-omori_gohan.gemspec
|
103
102
|
- lib/itamae/plugin/recipe/omori_gohan.rb
|
104
103
|
- lib/itamae/plugin/recipe/omori_gohan/default.rb
|
@@ -125,9 +124,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
125
124
|
version: '0'
|
126
125
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
126
|
requirements:
|
128
|
-
- - "
|
127
|
+
- - ">="
|
129
128
|
- !ruby/object:Gem::Version
|
130
|
-
version:
|
129
|
+
version: '0'
|
131
130
|
requirements: []
|
132
131
|
rubyforge_project:
|
133
132
|
rubygems_version: 2.5.1
|
data/ci/destroy_old_droplets.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# via. https://github.com/itamae-kitchen/itamae/blob/v1.9.3/ci/destroy_old_droplets.rb
|
2
|
-
require 'net/https'
|
3
|
-
require 'json'
|
4
|
-
require 'time'
|
5
|
-
|
6
|
-
http = Net::HTTP.new("api.digitalocean.com", 443)
|
7
|
-
http.use_ssl = true
|
8
|
-
|
9
|
-
res = http.start do
|
10
|
-
http.get("/v2/droplets", "Authorization" => "Bearer #{ENV['DIGITALOCEAN_ACCESS_TOKEN']}")
|
11
|
-
end
|
12
|
-
|
13
|
-
droplets = JSON.parse(res.body)['droplets']
|
14
|
-
droplets.each do |droplet|
|
15
|
-
next unless /^itamae-/ =~ droplet['name']
|
16
|
-
if Time.now - Time.parse(droplet['created_at']) >= 60 * 60
|
17
|
-
puts "destroying #{droplet}..."
|
18
|
-
res = http.start do
|
19
|
-
http.delete("/v2/droplets/#{droplet['id']}", "Authorization" => "Bearer #{ENV['DIGITALOCEAN_ACCESS_TOKEN']}")
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|