rrake 0.3.1 → 0.4.0
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 +8 -8
- data/exe/issue_rake +6 -0
- data/lib/rrake.rb +29 -3
- data/lib/rrake/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTEyYmE5ZmEzY2EyMWVjYTUxOGMxYzUwYWE5OTdlMTFiMTEzMGNjOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzU2YTI1OWI5NmJlYzdmZGRlYWEwNWZmZGFmZTk1YTZiMzM1MWY3Yg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZGZhZmUzNWYwYzlkMzc2MTVkMmRjODYzN2NkNWQ1ODRhZDU3MGVkN2JkYWYz
|
10
|
+
MWVmNjQ2YTRhNDFlNDcwYWQxYmVhNjZiOTI0OTcyMzZkM2UyODM4M2FhMDI1
|
11
|
+
YjEyMzkyOGNmNjI0NzUzOTUxMGVlNTNkNDQyMWFmOGNmNTkyZTk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODAzNTA3NzViMTRiYjE3NzI5YzMyN2ZkZTViMGZkYTVjZWM0MDg4ZjYwYTk5
|
14
|
+
MmE3Njc0MDBjZjNjNjE3ZTg4NmU0NjRkZjA3NDYzZDRmNjllYTRjOGU2Yjhh
|
15
|
+
OTZiY2FmMzM2MDEzZTI4ZGYzMWJlMDFmMDM1NzI0YjFlNzMwN2Q=
|
data/exe/issue_rake
ADDED
data/lib/rrake.rb
CHANGED
@@ -15,9 +15,9 @@ module Rrake
|
|
15
15
|
@logger = Logger.new logfile
|
16
16
|
@stop = false
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
@logger.fatal "Please ensure AWS_ACCESS_KEY is set." if @awsAccessKeyId.nil? or @awsAccessKeyId.empty?
|
19
|
+
@logger.fatal "Please ensure AWS_SECRET_ACCESS_KEY is set." if @awsSecretAccessKey.nil? or @awsSecretAccessKey.empty?
|
20
|
+
@logger.fatal "Please ensure RRAKE_QUEUE is set." if @rrakeQueue.nil? or @rrakeQueue.empty?
|
21
21
|
|
22
22
|
@logger.info "RRake is ready to do your remote bidding."
|
23
23
|
end
|
@@ -51,4 +51,30 @@ module Rrake
|
|
51
51
|
end
|
52
52
|
|
53
53
|
end
|
54
|
+
|
55
|
+
class IssueRrake
|
56
|
+
|
57
|
+
def initialize
|
58
|
+
@awsAccessKeyId = ENV['AWS_ACCESS_KEY']
|
59
|
+
@awsSecretAccessKey = ENV['AWS_SECRET_ACCESS_KEY']
|
60
|
+
@rrakeTopic = ENV['RRAKE_TOPIC']
|
61
|
+
logfile = ENV['RRAKE_LOGFILE_PATH'].nil? ? STDOUT : File.open(ENV['RRAKE_LOGFILE_PATH'], 'a')
|
62
|
+
@logger = Logger.new logfile
|
63
|
+
|
64
|
+
@logger.fatal "Please ensure AWS_ACCESS_KEY is set." if @awsAccessKeyId.nil? or @awsAccessKeyId.empty?
|
65
|
+
@logger.fatal "Please ensure AWS_SECRET_ACCESS_KEY is set." if @awsSecretAccessKey.nil? or @awsSecretAccessKey.empty?
|
66
|
+
@logger.fatal "Please ensure RRAKE_TOPIC is set." if @rrakeTopic.nil? or @rrakeTopic.empty?
|
67
|
+
end
|
68
|
+
|
69
|
+
def issue_command(command)
|
70
|
+
@logger.info "Issueing Command: #{command}"
|
71
|
+
sns = AWS::SNS.new(region: 'us-east-1', access_key_id: @awsAccessKeyId, secret_access_key: @awsSecretAccessKey)
|
72
|
+
@logger.info sns.topics[@rrakeTopic].publish(command)
|
73
|
+
rescue Exception => ex
|
74
|
+
@logger.error "Something cause an SQS failure."
|
75
|
+
@logger.error ex
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
54
80
|
end
|
data/lib/rrake/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rrake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- EmergeAdapt
|
@@ -71,6 +71,7 @@ description: Runs 'local' rake commands requested remotely via SNS. For example
|
|
71
71
|
email:
|
72
72
|
- development@emergeadapt.com
|
73
73
|
executables:
|
74
|
+
- issue_rake
|
74
75
|
- rrake
|
75
76
|
extensions: []
|
76
77
|
extra_rdoc_files: []
|
@@ -84,6 +85,7 @@ files:
|
|
84
85
|
- Rakefile
|
85
86
|
- bin/console
|
86
87
|
- bin/setup
|
88
|
+
- exe/issue_rake
|
87
89
|
- exe/rrake
|
88
90
|
- lib/rrake.rb
|
89
91
|
- lib/rrake/version.rb
|