rbcli 0.2.0 → 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/CHANGELOG.md +12 -1
- data/Gemfile.lock +7 -2
- data/README.md +43 -3
- data/bin/console +1 -1
- data/bin/setup +1 -1
- data/docs/404.html +12 -0
- data/docs/advanced/automatic_updates/index.html +12 -0
- data/docs/advanced/command_types/index.html +13 -1
- data/docs/advanced/distributed_state_locking/index.html +14 -2
- data/docs/advanced/hooks/index.html +12 -0
- data/docs/advanced/remote_execution/index.html +822 -0
- data/docs/advanced/state_storage/index.html +12 -0
- data/docs/advanced/user_config_files/index.html +12 -0
- data/docs/development/code_of_conduct/index.html +12 -0
- data/docs/development/contributing/index.html +15 -3
- data/docs/development/license/index.html +12 -0
- data/docs/imported/changelog/index.html +82 -7
- data/docs/imported/quick_reference/index.html +40 -1
- data/docs/index.html +15 -0
- data/docs/search/search_index.json +52 -12
- data/docs/sitemap.xml +23 -18
- data/docs/tutorial/10-getting_started/index.html +12 -0
- data/docs/tutorial/20-project_layout/index.html +12 -0
- data/docs/tutorial/30-your_first_command/index.html +12 -0
- data/docs/tutorial/40-options_parameters_and_arguments/index.html +12 -0
- data/docs/tutorial/50-publishing/index.html +12 -0
- data/docs/whoami/index.html +12 -0
- data/docs-src/docs/advanced/command_types.md +1 -1
- data/docs-src/docs/advanced/remote_execution.md +56 -0
- data/docs-src/docs/development/contributing.md +1 -1
- data/docs-src/docs/imported/changelog.md +12 -1
- data/docs-src/docs/imported/quick_reference.md +23 -1
- data/docs-src/docs/index.md +2 -0
- data/docs-src/mkdocs.yml +1 -0
- data/exe/rbcli +1 -1
- data/lib/rbcli/autoupdate/autoupdate.rb +1 -1
- data/lib/rbcli/autoupdate/gem_updater.rb +1 -1
- data/lib/rbcli/autoupdate/github_updater.rb +1 -1
- data/lib/rbcli/configuration/config.rb +1 -1
- data/lib/rbcli/configuration/configurate.rb +7 -2
- data/lib/rbcli/engine/command.rb +25 -3
- data/lib/rbcli/engine/load_project.rb +1 -1
- data/lib/rbcli/engine/parser.rb +10 -2
- data/lib/rbcli/logging/logging.rb +1 -1
- data/lib/rbcli/remote_exec/remote_exec.rb +187 -0
- data/lib/rbcli/scriptwrapping/scriptwrapper.rb +25 -5
- data/lib/rbcli/stateful_systems/configuratestorage.rb +1 -1
- data/lib/rbcli/stateful_systems/state_storage.rb +1 -1
- data/lib/rbcli/stateful_systems/storagetypes/localstate.rb +1 -1
- data/lib/rbcli/stateful_systems/storagetypes/remote_state_connectors/dynamodb.rb +1 -1
- data/lib/rbcli/stateful_systems/storagetypes/remotestate_dynamodb.rb +1 -1
- data/lib/rbcli/util/hash_deep_symbolize.rb +1 -1
- data/lib/rbcli/util/string_colorize.rb +1 -1
- data/lib/rbcli/version.rb +2 -2
- data/lib/rbcli-tool/generators.rb +1 -1
- data/lib/rbcli-tool/mdless_fix.rb +1 -1
- data/lib/rbcli-tool/project.rb +1 -1
- data/lib/rbcli-tool/util.rb +1 -1
- data/lib/rbcli-tool.rb +1 -1
- data/lib/rbcli.rb +5 -1
- data/lib-sh/lib-rbcli.sh +18 -9
- data/rbcli.gemspec +5 -2
- data/skeletons/project/application/commands/command.erb +1 -1
- data/skeletons/project/application/commands/script.erb +11 -7
- data/skeletons/project/application/options.rb +0 -5
- data/skeletons/project/config/general.rb +17 -0
- metadata +35 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a94207cc8d9ccc3375e64de968e15a7d350adf14ec90228695df0872e9d09623
|
4
|
+
data.tar.gz: f1ae271537500e57f19604cae534e50f2de19ab0c7960f42ec18370e9ff5248d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 584dc90981c04538c1adfca2b9d722d72b5d5ddf38c81c1b5ba88fef9992d5ab4e5f2ddf43697f3fe5923d5269e5fc86d9c9eff21db44892188072de27043910
|
7
|
+
data.tar.gz: 9b9e99a471c271cdcf3cb532a2bbe3a14be901bffffcbd75cd3b0901ff4abc74f72a794f65741dcc7c7958f1d1495f704df99381c2e2f25ca0624f4639051c3b
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,21 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.2.1 (Aug 8, 2018)
|
4
|
+
|
5
|
+
### Features
|
6
|
+
|
7
|
+
* Remote Execution added for Script and External commands
|
8
|
+
|
9
|
+
### Bugfixes
|
10
|
+
|
11
|
+
* Fixed a bug that caused RBCli to crash if a direct path mode script's environment variables were declared as symbols
|
12
|
+
|
13
|
+
|
3
14
|
## 0.2.0 (Aug 5, 2018)
|
4
15
|
|
5
16
|
### Features
|
6
17
|
|
18
|
+
* CLI tool Autoupdate Enabled; when an upgrade to RBCli is detected, the RBCli CLI tool will notify the developer.
|
7
19
|
* Official documentation created and hosted with Github Pages
|
8
20
|
* RBCli released under GPLv3
|
9
21
|
* Copyright/License notice displayed via RBCli tool with `rbcli license` in accordance with GPLv3 guidelines
|
@@ -17,7 +29,6 @@
|
|
17
29
|
### Improvements
|
18
30
|
|
19
31
|
* A quick reference guide can now be found in README.md
|
20
|
-
* CLI tool Autoupdate Enabled; when an upgrade to RBCli is detected, the RBCli CLI tool will notify the developer.
|
21
32
|
* Autoupdate feature now allows supplying a custom message
|
22
33
|
* Direct Path Mode for External Commands now
|
23
34
|
* Added support for a `lib` folder in projects, as a place for custom code, which is automatically added to `$LOAD_PATH` for developers
|
data/Gemfile.lock
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rbcli (0.2.
|
4
|
+
rbcli (0.2.1)
|
5
5
|
aws-sdk-dynamodb (~> 1.6)
|
6
6
|
colorize (~> 0.8)
|
7
7
|
deep_merge (~> 1.2)
|
8
8
|
macaddr (~> 1.7)
|
9
9
|
mdless (~> 0.0)
|
10
|
+
net-scp (~> 1.2)
|
11
|
+
net-ssh (~> 5.0)
|
10
12
|
octokit (~> 4.9)
|
11
13
|
rufus-scheduler (~> 3.5)
|
12
14
|
|
@@ -22,7 +24,7 @@ GEM
|
|
22
24
|
aws-partitions (~> 1.0)
|
23
25
|
aws-sigv4 (~> 1.0)
|
24
26
|
jmespath (~> 1.0)
|
25
|
-
aws-sdk-dynamodb (1.
|
27
|
+
aws-sdk-dynamodb (1.10.0)
|
26
28
|
aws-sdk-core (~> 3)
|
27
29
|
aws-sigv4 (~> 1.0)
|
28
30
|
aws-sigv4 (1.0.3)
|
@@ -41,6 +43,9 @@ GEM
|
|
41
43
|
mdless (0.0.10)
|
42
44
|
minitest (5.11.3)
|
43
45
|
multipart-post (2.0.0)
|
46
|
+
net-scp (1.2.1)
|
47
|
+
net-ssh (>= 2.6.5)
|
48
|
+
net-ssh (5.0.2)
|
44
49
|
octokit (4.9.0)
|
45
50
|
sawyer (~> 0.8.0, >= 0.5.3)
|
46
51
|
public_suffix (3.0.2)
|
data/README.md
CHANGED
@@ -1,6 +1,22 @@
|
|
1
|
+
# RBCli
|
2
|
+
|
1
3
|
RBCli is currently in Alpha stages of development. All releases can be considered stable, though breaking changes may be made between versions.
|
2
4
|
|
3
|
-
|
5
|
+
Latest Release: v0.2.1 (Aug 8, 2018) -- See the [changelog][changelog] for complete details.
|
6
|
+
|
7
|
+
* Remote Execution Feature Added
|
8
|
+
|
9
|
+
Previous Release: v0.2.0 (Aug 5, 2018)
|
10
|
+
|
11
|
+
* CLI tool Autoupdate Enabled; when an upgrade to RBCli is detected, the RBCli CLI tool will notify the developer.
|
12
|
+
* Official documentation created and hosted with Github Pages
|
13
|
+
* RBCli released under GPLv3
|
14
|
+
* Copyright/License notice displayed via RBCli tool with `rbcli license` in accordance with GPLv3 guidelines
|
15
|
+
* Many improvements and bugfixes
|
16
|
+
|
17
|
+
[You can find the Official Documentation for RBCli Here.][documentation_home]
|
18
|
+
|
19
|
+
## Introduction
|
4
20
|
|
5
21
|
As technologists today, we work with the command line a lot. We script a lot. We write tools to share with each other to make our lives easier. We even write applications to make up for missing features in the 3rd party software that we buy. Unfortunately, when writing CLI tools, this process has typically been very painful. We've been working with low-level frameworks for decades; frameworks like `getopt` (1980) and `curses` (1977). They fit their purpose well; they were both computationally lightweight for the computers of the day, and they gave engineers full control and flexibility when it came to how things were built. Over the years, we've used them to settle on several design patterns that we know work well. Patterns as to what a CLI command looks like, what a config file looks like, what remote execution looks like, and even how to use locks (mutexes, semaphores, etc) to control application flow and data atomicity. Yet we're stuck writing the same low-level code anytime we want to write our tooling. Not anymore.
|
6
22
|
|
@@ -31,8 +47,10 @@ Some of its key features include:
|
|
31
47
|
|
32
48
|
* __Project Structure and Generators__: Create a well-defined project directory structure which organizes your code and allows you to package and distribute your application as a Gem. Generators can also help speed up the process of creating new commands, scripts, and hooks!
|
33
49
|
|
50
|
+
* __Remote Execution__: Automatically execute commands on remote machines via SSH
|
34
51
|
|
35
|
-
|
52
|
+
|
53
|
+
For more information, take a look at the __[official documentation][documentation_home]__ or keep reading for a quick reference.
|
36
54
|
|
37
55
|
|
38
56
|
# Quick Reference
|
@@ -169,13 +187,34 @@ RBCli can automatically notify users when an update is available. Two sources ar
|
|
169
187
|
You can configure automatic updates in `config/autoupdate.rb` in your project.
|
170
188
|
|
171
189
|
|
190
|
+
## Remote Execution
|
191
|
+
|
192
|
+
RBCli can automatically execute script and extern commands on remote machines via SSH. Enable this feature in `config/general.rb` by changing the following line to `true`:
|
193
|
+
|
194
|
+
```ruby
|
195
|
+
remote_execution permitted: false
|
196
|
+
```
|
197
|
+
|
198
|
+
Then for each command you want to enable remote execution for, add the following directive:
|
199
|
+
|
200
|
+
```ruby
|
201
|
+
remote_permitted
|
202
|
+
```
|
203
|
+
|
204
|
+
Users can then execute commands remotly by specifying the connection string and credentials on the command line:
|
205
|
+
|
206
|
+
```bash
|
207
|
+
mytool --remote-exec [user@]host[:port] --identity (/path/to/private/ssh/key or password) <command> ...
|
208
|
+
```
|
209
|
+
|
210
|
+
|
172
211
|
## Development and Contributing
|
173
212
|
|
174
213
|
For more information about development and contributing, please see the [Official Development Documentation][documentation_development]
|
175
214
|
|
176
215
|
## License
|
177
216
|
|
178
|
-
The gem is available as open source under the terms of the [GPLv3]
|
217
|
+
The gem is available as open source under the terms of the [GPLv3][license_text].
|
179
218
|
|
180
219
|
## Full Documentation
|
181
220
|
|
@@ -185,3 +224,4 @@ The gem is available as open source under the terms of the [GPLv3](https://githu
|
|
185
224
|
[documentation_home]: https://akhoury6.github.com/rbcli
|
186
225
|
[documentation_development]: https://akhoury6.github.com/rbcli/development/contributing/
|
187
226
|
[license_text]: https://github.com/akhoury6/rbcli/blob/master/LICENSE.txt
|
227
|
+
[changelog]: https://github.com/akhoury6/rbcli/blob/master/CHANGELOG.md
|
data/bin/console
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
# You should have received a copy of the GNU General Public License #
|
17
17
|
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
|
18
18
|
# #
|
19
|
-
# For questions regarding licensing, please contact andrew@blacknex.us
|
19
|
+
# For questions regarding licensing, please contact andrew@blacknex.us #
|
20
20
|
##################################################################################
|
21
21
|
|
22
22
|
require "bundler/setup"
|
data/bin/setup
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
# You should have received a copy of the GNU General Public License #
|
17
17
|
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
|
18
18
|
# #
|
19
|
-
# For questions regarding licensing, please contact andrew@blacknex.us
|
19
|
+
# For questions regarding licensing, please contact andrew@blacknex.us #
|
20
20
|
##################################################################################
|
21
21
|
|
22
22
|
set -euo pipefail
|
data/docs/404.html
CHANGED
@@ -489,6 +489,18 @@
|
|
489
489
|
</li>
|
490
490
|
|
491
491
|
|
492
|
+
|
493
|
+
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
<li class="md-nav__item">
|
498
|
+
<a href="/advanced/remote_execution/" title="Remote Execution" class="md-nav__link">
|
499
|
+
Remote Execution
|
500
|
+
</a>
|
501
|
+
</li>
|
502
|
+
|
503
|
+
|
492
504
|
</ul>
|
493
505
|
</nav>
|
494
506
|
</li>
|
@@ -576,6 +576,18 @@
|
|
576
576
|
</li>
|
577
577
|
|
578
578
|
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
|
584
|
+
<li class="md-nav__item">
|
585
|
+
<a href="../remote_execution/" title="Remote Execution" class="md-nav__link">
|
586
|
+
Remote Execution
|
587
|
+
</a>
|
588
|
+
</li>
|
589
|
+
|
590
|
+
|
579
591
|
</ul>
|
580
592
|
</nav>
|
581
593
|
</li>
|
@@ -814,7 +826,7 @@ end
|
|
814
826
|
<p>This will create two files in your RBCli project: a Ruby file with the common command declaration (see <a href="#general-command-structure">General Command Structure</a>), and a bash script in the folder <code>application/commands/scripts/</code>.</p>
|
815
827
|
<p>You can tell a command is a script by the line:</p>
|
816
828
|
<pre><code class="ruby">class List < Rbcli::Command
|
817
|
-
|
829
|
+
script
|
818
830
|
end
|
819
831
|
</code></pre>
|
820
832
|
|
@@ -535,6 +535,18 @@
|
|
535
535
|
</li>
|
536
536
|
|
537
537
|
|
538
|
+
|
539
|
+
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
<li class="md-nav__item">
|
544
|
+
<a href="../remote_execution/" title="Remote Execution" class="md-nav__link">
|
545
|
+
Remote Execution
|
546
|
+
</a>
|
547
|
+
</li>
|
548
|
+
|
549
|
+
|
538
550
|
</ul>
|
539
551
|
</nav>
|
540
552
|
</li>
|
@@ -725,13 +737,13 @@
|
|
725
737
|
</a>
|
726
738
|
|
727
739
|
|
728
|
-
<a href="
|
740
|
+
<a href="../remote_execution/" title="Remote Execution" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
|
729
741
|
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
|
730
742
|
<span class="md-flex__ellipsis">
|
731
743
|
<span class="md-footer-nav__direction">
|
732
744
|
Next
|
733
745
|
</span>
|
734
|
-
|
746
|
+
Remote Execution
|
735
747
|
</span>
|
736
748
|
</div>
|
737
749
|
<div class="md-flex__cell md-flex__cell--shrink">
|