infopark_opsworks_helpers 0.1.1 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +20 -4
- data/app/assets/javascripts/opsworks_helpers/application.js +13 -0
- data/app/assets/stylesheets/opsworks_helpers/application.css +15 -0
- data/app/controllers/opsworks_helpers/application_controller.rb +27 -0
- data/app/helpers/opsworks_helpers/application_helper.rb +4 -0
- data/app/views/layouts/opsworks_helpers/application.html.erb +14 -0
- data/config/routes.rb +6 -0
- data/lib/{infopark_opsworks_helpers → opsworks_helpers}/deploy.rb +1 -1
- data/lib/opsworks_helpers/engine.rb +9 -0
- data/lib/opsworks_helpers/status_checks.rb +25 -0
- data/lib/opsworks_helpers/version.rb +3 -0
- data/lib/opsworks_helpers.rb +9 -0
- data/lib/tasks/{infopark_opsworks_helpers.rake → opsworks_helpers_tasks.rake} +1 -1
- metadata +57 -16
- data/.gitignore +0 -9
- data/.rspec +0 -2
- data/.travis.yml +0 -4
- data/Gemfile +0 -3
- data/README.md +0 -47
- data/bin/console +0 -14
- data/bin/setup +0 -7
- data/infopark_opsworks_helpers.gemspec +0 -23
- data/lib/infopark_opsworks_helpers/railtie.rb +0 -10
- data/lib/infopark_opsworks_helpers/version.rb +0 -5
- data/lib/infopark_opsworks_helpers.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ab16c2081c143434e0bbd05bbfd476701f06e51
|
4
|
+
data.tar.gz: 81d3988949d9855f622b9da592f477c68be9bda9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 241313224c4e10645be044566bf352a0f0eef695a3131b0f959910c7631373beac0627b8ebdf1c8a81192f27bcb6c0c87a6f5e8494688da530d275f4ee8a23b1
|
7
|
+
data.tar.gz: 0bfc5ab53128488a6133094dd7c3300569eb753468c1ae0711ce2a04a40ff602199ef91e18b3e8ca2a875b5d9dbf7d799f4000f7e16cba9258fd91773d8ca6f8
|
data/Rakefile
CHANGED
@@ -1,6 +1,22 @@
|
|
1
|
-
|
2
|
-
require
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
3
6
|
|
4
|
-
|
7
|
+
require 'rdoc/task'
|
5
8
|
|
6
|
-
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'OpsworksHelpers'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
load 'rails/tasks/statistics.rake'
|
21
|
+
|
22
|
+
Bundler::GemHelper.install_tasks
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require_tree .
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
+
* file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module OpsworksHelpers
|
2
|
+
class ApplicationController < ActionController::Base
|
3
|
+
|
4
|
+
def healthcheck
|
5
|
+
head 200
|
6
|
+
end
|
7
|
+
|
8
|
+
def status
|
9
|
+
if command_block = OpsworksHelpers.status_checks.presence
|
10
|
+
checks = StatusChecks.new(command_block)
|
11
|
+
checks.execute
|
12
|
+
@errors = checks.errors
|
13
|
+
end
|
14
|
+
|
15
|
+
if @errors.present?
|
16
|
+
render json: {
|
17
|
+
status: :internal_server_error,
|
18
|
+
message: 'Something went wrong',
|
19
|
+
errors: @errors
|
20
|
+
}, status: :internal_server_error
|
21
|
+
else
|
22
|
+
render json: {status: :ok, message: 'Everything is awesome!'}
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>OpsworksHelpers</title>
|
5
|
+
<%= stylesheet_link_tag "opsworks_helpers/application", media: "all" %>
|
6
|
+
<%= javascript_include_tag "opsworks_helpers/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
module OpsworksHelpers
|
2
|
+
class StatusChecks
|
3
|
+
|
4
|
+
attr_reader :command_block
|
5
|
+
attr_accessor :result
|
6
|
+
|
7
|
+
def initialize(command_block)
|
8
|
+
@command_block = command_block
|
9
|
+
@result = [true, {}]
|
10
|
+
end
|
11
|
+
|
12
|
+
def execute
|
13
|
+
self.result = command_block.call
|
14
|
+
end
|
15
|
+
|
16
|
+
def failed?
|
17
|
+
result[0] == false
|
18
|
+
end
|
19
|
+
|
20
|
+
def errors
|
21
|
+
result[1]
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infopark_opsworks_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Infopark AG
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-11-
|
12
|
+
date: 2015-11-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '10.0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
|
-
name: rspec
|
43
|
+
name: rspec-rails
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - ">="
|
@@ -53,6 +53,48 @@ dependencies:
|
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: sqlite3
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rails
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '4.2'
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '4.2'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: haml-rails
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
type: :runtime
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
56
98
|
- !ruby/object:Gem::Dependency
|
57
99
|
name: aws-sdk
|
58
100
|
requirement: !ruby/object:Gem::Requirement
|
@@ -74,20 +116,19 @@ executables: []
|
|
74
116
|
extensions: []
|
75
117
|
extra_rdoc_files: []
|
76
118
|
files:
|
77
|
-
- ".gitignore"
|
78
|
-
- ".rspec"
|
79
|
-
- ".travis.yml"
|
80
|
-
- Gemfile
|
81
|
-
- README.md
|
82
119
|
- Rakefile
|
83
|
-
-
|
84
|
-
-
|
85
|
-
-
|
86
|
-
-
|
87
|
-
-
|
88
|
-
-
|
89
|
-
- lib/
|
90
|
-
- lib/
|
120
|
+
- app/assets/javascripts/opsworks_helpers/application.js
|
121
|
+
- app/assets/stylesheets/opsworks_helpers/application.css
|
122
|
+
- app/controllers/opsworks_helpers/application_controller.rb
|
123
|
+
- app/helpers/opsworks_helpers/application_helper.rb
|
124
|
+
- app/views/layouts/opsworks_helpers/application.html.erb
|
125
|
+
- config/routes.rb
|
126
|
+
- lib/opsworks_helpers.rb
|
127
|
+
- lib/opsworks_helpers/deploy.rb
|
128
|
+
- lib/opsworks_helpers/engine.rb
|
129
|
+
- lib/opsworks_helpers/status_checks.rb
|
130
|
+
- lib/opsworks_helpers/version.rb
|
131
|
+
- lib/tasks/opsworks_helpers_tasks.rake
|
91
132
|
homepage: https://github.com/infopark/opsworks-helpers
|
92
133
|
licenses: []
|
93
134
|
metadata: {}
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/README.md
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
# Infopark OpsworksHelpers
|
2
|
-
|
3
|
-
## Installation
|
4
|
-
|
5
|
-
Add this line to your application's Gemfile:
|
6
|
-
|
7
|
-
```ruby
|
8
|
-
gem 'infopark_opsworks_helpers'
|
9
|
-
```
|
10
|
-
|
11
|
-
And then execute:
|
12
|
-
|
13
|
-
$ bundle
|
14
|
-
|
15
|
-
Or install it yourself as:
|
16
|
-
|
17
|
-
$ gem install infopark_opsworks_little_helpers
|
18
|
-
|
19
|
-
## Usage
|
20
|
-
|
21
|
-
### General
|
22
|
-
|
23
|
-
The tasks defined in this gem expect the following ENV variables to be set:
|
24
|
-
|
25
|
-
```ruby
|
26
|
-
AWS_ACCESS_KEY_ID
|
27
|
-
AWS_SECRET_ACCESS_KEY
|
28
|
-
AWS_OPSWORKS_STACK_ID
|
29
|
-
AWS_OPSWORKS_APP_ID
|
30
|
-
```
|
31
|
-
|
32
|
-
### Rails
|
33
|
-
|
34
|
-
After adding to the Gemfile you can see the available rake tasks with
|
35
|
-
|
36
|
-
$ bundle exec rake -T opsworks
|
37
|
-
|
38
|
-
## Development
|
39
|
-
|
40
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
41
|
-
|
42
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
43
|
-
|
44
|
-
## Contributing
|
45
|
-
|
46
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/infopark/infopark_opsworks_little_helpers.
|
47
|
-
|
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "infopark_opsworks_little_helpers"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start
|
data/bin/setup
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'infopark_opsworks_helpers/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "infopark_opsworks_helpers"
|
8
|
-
spec.version = Infopark::OpsworksHelpers::VERSION
|
9
|
-
spec.authors = ["Infopark AG", "Benjamin Zimmer"]
|
10
|
-
spec.email = ["info@infopark.de"]
|
11
|
-
|
12
|
-
spec.summary = %q{Provides little helper functions for managing AWS OpsWorks stacks.}
|
13
|
-
spec.homepage = "https://github.com/infopark/opsworks-helpers"
|
14
|
-
|
15
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
16
|
-
spec.require_paths = ["lib"]
|
17
|
-
|
18
|
-
spec.add_development_dependency "bundler", "~> 1.10"
|
19
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
20
|
-
spec.add_development_dependency "rspec"
|
21
|
-
|
22
|
-
spec.add_dependency "aws-sdk", "~>2"
|
23
|
-
end
|