cloudimages-rundeck 0.1.3 → 0.1.4
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 +4 -4
- data/CHANGELOG.md +33 -0
- data/Gemfile +0 -2
- data/cloudimages-rundeck.gemspec +2 -2
- data/lib/cloudimages-rundeck/api.rb +2 -2
- data/lib/cloudimages-rundeck/cli.rb +3 -4
- data/lib/cloudimages-rundeck/config.rb +1 -1
- data/lib/cloudimages-rundeck/do.rb +9 -5
- data/lib/cloudimages-rundeck/util.rb +1 -1
- data/lib/cloudimages-rundeck/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 058b890b179864b3c654909375c000c783a337d3
|
4
|
+
data.tar.gz: dfefc9b164eeebd437bcf927b6baeb230723450f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f202b13266ab5a01af9525a09ae5802b4fedc25d97303dbc4fe1f347ec84e9346aa7e32a02304fd4fb54b8a57f17528fc536b6e352debfc009c787d70fccd7c6
|
7
|
+
data.tar.gz: f459398e779a62e6590104d382c059797cc88f4ac6f8efbc54cb98714e27162a7e8f20bb000b39014eb19f50490f547ab6d8ffc6faec27072fe8957fe40d54e4
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
CloudImages-RunDeck Changelog
|
2
|
+
=========================
|
3
|
+
This file is used to list changes made in each version of the `cloudimages-rundeck` gem.
|
4
|
+
|
5
|
+
v0.1.4 (2016-10-31)
|
6
|
+
-------------------
|
7
|
+
### Improvements
|
8
|
+
- Ensure that we never nuke all images during cleanup. `keep` must be set greater than or equal to 1
|
9
|
+
- Better return validation & error handling for `cleanup` endpoint
|
10
|
+
- Security: Hide `config` endpoint unless running in development mode
|
11
|
+
|
12
|
+
v0.1.3 (2016-10-28)
|
13
|
+
-------------------
|
14
|
+
### Improvements
|
15
|
+
- Added Image Cleanup endpoint - ` POST /images/v1/cleanup`
|
16
|
+
- Use the `filter` query_param to filter the images
|
17
|
+
- Use the `keep` query_param to specify how many images to keep
|
18
|
+
- If either of these are not specified, the return will be null
|
19
|
+
- Currently sorts by ImageID in descending order. The first `keep` images will be kept
|
20
|
+
|
21
|
+
v0.1.2 (2016-10-07)
|
22
|
+
-------------------
|
23
|
+
### Bug Fixes
|
24
|
+
- Fixed value return for RunDeck consumption -- It only likes string values, not integers.
|
25
|
+
|
26
|
+
v0.1.1 (2016-10-06)
|
27
|
+
-------------------
|
28
|
+
### Improvements
|
29
|
+
- Security: Add ability to check if a string is an existing file, and return its content. This keeps keys out of config files.
|
30
|
+
|
31
|
+
v0.1.0 (2016-10-06)
|
32
|
+
-------------------
|
33
|
+
- Initial Release
|
data/Gemfile
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
gem 'droplet_kit' # => DigitalOcean API Interaction
|
4
|
-
# => gem 'hashie' # => Data Structure
|
5
|
-
# => gem 'logify' # => Logging
|
6
4
|
gem 'mixlib-cli' # => Option Parsing
|
7
5
|
gem 'rack-cache' # => Cache Responses
|
8
6
|
gem 'sinatra' # => Web Server
|
data/cloudimages-rundeck.gemspec
CHANGED
@@ -30,8 +30,8 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.require_paths = ['lib']
|
31
31
|
|
32
32
|
# => Dependencies
|
33
|
-
spec.add_runtime_dependency 'droplet_kit', '~>
|
34
|
-
spec.add_runtime_dependency 'mixlib-cli', '~> 1.
|
33
|
+
spec.add_runtime_dependency 'droplet_kit', '~> 2.0'
|
34
|
+
spec.add_runtime_dependency 'mixlib-cli', '~> 1.7'
|
35
35
|
spec.add_runtime_dependency 'rack-cache', '~> 1.6'
|
36
36
|
spec.add_runtime_dependency 'sinatra', '~> 1.4'
|
37
37
|
spec.add_runtime_dependency 'sinatra-contrib', '~> 1.4'
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# rubocop: disable LineLength
|
3
3
|
#
|
4
4
|
# Gem Name:: cloudimages-rundeck
|
5
|
-
#
|
5
|
+
# CloudImagesRunDeck:: API
|
6
6
|
#
|
7
7
|
# Copyright (C) 2016 Brian Dwyer - Intelligent Digital Services
|
8
8
|
#
|
@@ -67,7 +67,7 @@ module CloudImagesRunDeck
|
|
67
67
|
{ 'Sinatra Info' => env }
|
68
68
|
].compact
|
69
69
|
)
|
70
|
-
end
|
70
|
+
end if development?
|
71
71
|
|
72
72
|
########################
|
73
73
|
# => JSON API <= #
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# rubocop: disable LineLength, MethodLength, AbcSize
|
3
3
|
#
|
4
4
|
# Gem Name:: cloudimages-rundeck
|
5
|
-
#
|
5
|
+
# CloudImagesRunDeck:: CLI
|
6
6
|
#
|
7
7
|
# Copyright (C) 2016 Brian Dwyer - Intelligent Digital Services
|
8
8
|
#
|
@@ -54,8 +54,7 @@ module CloudImagesRunDeck
|
|
54
54
|
option :environment,
|
55
55
|
short: '-e ENV',
|
56
56
|
long: '--env ENV',
|
57
|
-
description:
|
58
|
-
default: 'production'
|
57
|
+
description: "Sets the environment for cloudimages-rundeck to execute under. Use 'development' for more logging. (Default: #{Config.environment})"
|
59
58
|
end
|
60
59
|
|
61
60
|
# => Launch the Application
|
@@ -79,7 +78,7 @@ module CloudImagesRunDeck
|
|
79
78
|
cfg.cache_timeout = config[:cache_timeout].to_i
|
80
79
|
cfg.bind = config[:bind]
|
81
80
|
cfg.port = config[:port]
|
82
|
-
cfg.environment = config[:environment].to_sym
|
81
|
+
cfg.environment = config[:environment].to_sym.downcase
|
83
82
|
cfg.do_api_key = config[:do_api_key]
|
84
83
|
end
|
85
84
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# rubocop: disable LineLength
|
3
3
|
#
|
4
4
|
# Gem Name:: cloudimages-rundeck
|
5
|
-
#
|
5
|
+
# CloudImagesRunDeck:: Do
|
6
6
|
#
|
7
7
|
# Copyright (C) 2016 Brian Dwyer - Intelligent Digital Services
|
8
8
|
#
|
@@ -55,12 +55,16 @@ module CloudImagesRunDeck
|
|
55
55
|
#
|
56
56
|
def cleanup_images # rubocop:disable AbcSize
|
57
57
|
# => Ensure we have a Filter
|
58
|
-
return unless Config.query_params['filter'] && Config.query_params['keep']
|
58
|
+
return unless Config.query_params['filter'] && Config.query_params['keep'].to_i >= 1
|
59
59
|
|
60
|
-
# => Grab the Images
|
60
|
+
# => Grab the Images & Sort by ImageID
|
61
61
|
# => NOTE: If ImageID's aren't reliable, try DateTime.parse(hsh['name']) for sorting
|
62
|
-
|
63
|
-
|
62
|
+
cleanup = list_images.sort_by { |img| img['value'] }.reverse.drop(Config.query_params['keep'].to_i)
|
63
|
+
|
64
|
+
return unless cleanup.is_a?(Array)
|
65
|
+
|
66
|
+
# => Delete the Images
|
67
|
+
cleanup.each do |img|
|
64
68
|
do_client.images.delete(id: img['value'])
|
65
69
|
end
|
66
70
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudimages-rundeck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Dwyer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: droplet_kit
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mixlib-cli
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.7'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.7'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rack-cache
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -147,6 +147,7 @@ files:
|
|
147
147
|
- ".gitignore"
|
148
148
|
- ".gitlab-ci.yml"
|
149
149
|
- ".rubocop.yml"
|
150
|
+
- CHANGELOG.md
|
150
151
|
- Gemfile
|
151
152
|
- Gemfile.lock
|
152
153
|
- LICENSE.txt
|