rs-mule 0.0.1
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 +15 -0
- data/LICENSE +18 -0
- data/README.md +149 -0
- data/bin/rs-mule +24 -0
- metadata +75 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZDA0NmVlMGNmZWE4YTNjNmQ1NGZmM2ZiNTY0MGFjNjBjMzlmZmYyMg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
OTZlMTEwZjBlNzJjOWI2MzQ4MGY2ZWFjM2E4MGM2N2NhOWY0MDc0Yw==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MjQ4NTViOTgxZDQ2MmQ2YzJkMWE1NWJiZjgwNjBmNmFlMTNkMWZiMzExYmYz
|
10
|
+
OGQ5NjRhNjc0MWZiNjM3YjljNzk5YmEwOGI4MWRkOWVkNTg5NzBmY2E4M2E2
|
11
|
+
MDg3NzAyN2QyN2Y5NDNmNWMzZDFiMmY3MThhYzUwNTFjZmI3MWU=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NjY0NDgzMmI3ZGU4NjMyNTUyOTcxMjcxZDRjMDVjMmZjNDIxYzMwNjhjODkx
|
14
|
+
YjA1YTEzOGZmZDFhNmYwMGNkZGQ1OGI4MDkwY2U1Y2UyYWMzZmZjYWNkZGRm
|
15
|
+
NWZkN2EyNWMyYWFiZjUyZjAzNmMzODAyYWMyZDhkNWU5ZTk5ZmE=
|
data/LICENSE
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Copyright (c) 2014 Ryan Geyer
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
4
|
+
this software and associated documentation files (the "Software"), to deal in
|
5
|
+
the Software without restriction, including without limitation the rights to
|
6
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
7
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
8
|
+
subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
15
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
16
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
17
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
18
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,149 @@
|
|
1
|
+
# rs-mule
|
2
|
+
|
3
|
+
A [CLI](./#CLI) tool that runs "stuff". Meant primarily for running RightScripts or Chef recipes on individual nodes, identified by tags.
|
4
|
+
|
5
|
+
Also a [Library](./#Library) that allows you to do the same sorta stuff in your own app, cause I'm generous like that.
|
6
|
+
|
7
|
+
[<img src="https://travis-ci.org/rgeyer/rs-mule.png" />](https://travis-ci.org/rgeyer/rs-mule)
|
8
|
+
|
9
|
+
## CLI
|
10
|
+
|
11
|
+
### Authentication
|
12
|
+
The CLI requires you to authenticate with right_api_client. Typically providing
|
13
|
+
your rightscale email address, password, and an account id are sufficient for
|
14
|
+
getting authenticated. However you can also use an oAuth token. For more
|
15
|
+
information on the required parameters check out the
|
16
|
+
[right_api_client documentation](https://github.com/rightscale/right_api_client)
|
17
|
+
|
18
|
+
When using the CLI you can provide RightScale API authentication info in two ways.
|
19
|
+
|
20
|
+
#### rs_auth_hash
|
21
|
+
Perhaps the easiest way to provide the authentication parameters is on the
|
22
|
+
commandline with the --rs-auth-hash option.
|
23
|
+
|
24
|
+
Example:
|
25
|
+
```
|
26
|
+
rs-mule [COMMAND] --rs-auth-hash=email:foo@bar.baz password:password account_id:12345
|
27
|
+
```
|
28
|
+
|
29
|
+
#### rs_auth_file
|
30
|
+
You can also create a YAML file which contains the authentication parameters you
|
31
|
+
want to supply, then point rs-mule at your authentication parameter file.
|
32
|
+
|
33
|
+
You can find an example of this file at the root of this project as
|
34
|
+
"auth_file.yaml.example", and it looks a little like this.
|
35
|
+
|
36
|
+
Example File:
|
37
|
+
```
|
38
|
+
---
|
39
|
+
:email: foo@bar.baz
|
40
|
+
:password: password
|
41
|
+
:account_id: 12345
|
42
|
+
```
|
43
|
+
|
44
|
+
You can tell rs-mule to use your parameters file thusly.
|
45
|
+
|
46
|
+
Example:
|
47
|
+
```
|
48
|
+
rs-mule [COMMAND] --rs-auth-file=/path/to/auth_file.yaml
|
49
|
+
```
|
50
|
+
|
51
|
+
### Usage
|
52
|
+
|
53
|
+
rs-mule has one (soon to be two) commands.
|
54
|
+
|
55
|
+
```
|
56
|
+
Commands:
|
57
|
+
rs-mule help [COMMAND] # Describe available commands or one specific command
|
58
|
+
rs-mule run_executable --tags=one two three # Runs a specified recipe or RightScript on instances targeted by tag
|
59
|
+
```
|
60
|
+
|
61
|
+
#### run_executable command
|
62
|
+
This is used to run a RightScript or Chef recipe on instances found using a tag
|
63
|
+
search.
|
64
|
+
|
65
|
+
The simplest usage requires the executable to run, and at least one tag.
|
66
|
+
```
|
67
|
+
rs-mule run_executable "Some RightScript Name" --tags=tag1
|
68
|
+
```
|
69
|
+
|
70
|
+
##### Tag Matching Strategy
|
71
|
+
If you provide more than one tag, rs-mule will assume that you want target
|
72
|
+
instances to possess all of the supplied tags in order for the executable to be
|
73
|
+
run on them. However, you can be a little more lenient and have rs-mule run the
|
74
|
+
executable on instances which have any of the tags.
|
75
|
+
|
76
|
+
Script will run only on instances which have both "tag1" and "tag2"
|
77
|
+
```
|
78
|
+
rs-mule run_executable "Some RightScript Name" --tags=tag1 tag2
|
79
|
+
```
|
80
|
+
|
81
|
+
The explicit version of above
|
82
|
+
```
|
83
|
+
rs-mule run_executable "Some RightScript Name" --tags=tag1 tag2 --tag-match-strategy=all
|
84
|
+
```
|
85
|
+
|
86
|
+
Script will run on any instance which has either "tag1" or "tag2"
|
87
|
+
```
|
88
|
+
rs-mule run_executable "Some RightScript Name" --tags=tag1 tag2 --tag-match-strategy=any
|
89
|
+
```
|
90
|
+
|
91
|
+
##### RightScript Version
|
92
|
+
When you are running a RightScript, rs-mule will assume you want to run the
|
93
|
+
latest and greatest version. It'll also assume that revision is not the HEAD
|
94
|
+
revision. You can supply a specified revision number, or use 0 if you want to
|
95
|
+
live on the edge and use the HEAD revision.
|
96
|
+
|
97
|
+
Specify revision 3
|
98
|
+
```
|
99
|
+
rs-mule run_executable "Some RightScript Name" --tags=tag1 --right-script-revision=3
|
100
|
+
```
|
101
|
+
|
102
|
+
Specify HEAD revision
|
103
|
+
```
|
104
|
+
rs-mule run_executable "Some RightScript Name" --tags=tag1 --right-script-revision=0
|
105
|
+
```
|
106
|
+
|
107
|
+
##### Executable Type
|
108
|
+
The executable value can be one of the following;
|
109
|
+
* The name of a RightScript
|
110
|
+
* An API href of a RightScript (Eg. /api/right_scripts/abc123)
|
111
|
+
* The name of a Chef recipe (Eg. cookbook::recipe)
|
112
|
+
|
113
|
+
rs-mule will attempt to automatically detect which one you've supplied by applying
|
114
|
+
some regular expressions and other detection mechanisms against the executable
|
115
|
+
string provided.
|
116
|
+
|
117
|
+
However, you can remove the guesswork by specifying the executable type as an
|
118
|
+
option.
|
119
|
+
|
120
|
+
RightScript HREF:
|
121
|
+
```
|
122
|
+
rs-mule run_executable "/api/right_scripts/abc123" --executable-type=right_script_href --tags=tag1
|
123
|
+
```
|
124
|
+
|
125
|
+
RightScript Name:
|
126
|
+
```
|
127
|
+
rs-mule run_executable "Some RightScript Name" --executable-type=right_script_name --tags=tag1
|
128
|
+
```
|
129
|
+
|
130
|
+
Chef Recipe:
|
131
|
+
```
|
132
|
+
rs-mule run_executable "cookbook::recipe" --executable-type=recipe_name --tags=tag1
|
133
|
+
```
|
134
|
+
|
135
|
+
## Library
|
136
|
+
The library does all this cool stuff, and I'll document it, I swear...
|
137
|
+
|
138
|
+
## Authors
|
139
|
+
|
140
|
+
Created and maintained by [Ryan Geyer][author] (<me@ryangeyer.com>)
|
141
|
+
|
142
|
+
## License
|
143
|
+
|
144
|
+
MIT (see [LICENSE][license])
|
145
|
+
|
146
|
+
[author]: https://github.com/rgeyer
|
147
|
+
[issues]: https://github.com/rgeyer/rs-mule/issues
|
148
|
+
[license]: https://github.com/rgeyer/rs-mule/blob/master/LICENSE
|
149
|
+
[repo]: https://github.com/rgeyer/rs-mule
|
data/bin/rs-mule
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Copyright (c) 2014 Ryan Geyer
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
# this software and associated documentation files (the "Software"), to deal in
|
7
|
+
# the Software without restriction, including without limitation the rights to
|
8
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
# subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "lib", "rs-mule"))
|
23
|
+
|
24
|
+
RsMule::Cli.start(ARGV)
|
metadata
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rs-mule
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ryan J. Geyer
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-03-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: right_api_client
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.5.15
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.5.15
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: thor
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.18.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.18.1
|
41
|
+
description: It runs "stuff"
|
42
|
+
email: me@ryangeyer.com
|
43
|
+
executables:
|
44
|
+
- rs-mule
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- LICENSE
|
49
|
+
- README.md
|
50
|
+
- bin/rs-mule
|
51
|
+
homepage: https://github.com/rgeyer/rs-mule
|
52
|
+
licenses:
|
53
|
+
- MIT
|
54
|
+
metadata: {}
|
55
|
+
post_install_message:
|
56
|
+
rdoc_options: []
|
57
|
+
require_paths:
|
58
|
+
- lib
|
59
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ! '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
requirements: []
|
70
|
+
rubyforge_project:
|
71
|
+
rubygems_version: 2.2.2
|
72
|
+
signing_key:
|
73
|
+
specification_version: 4
|
74
|
+
summary: It runs "stuff"
|
75
|
+
test_files: []
|