MuranoCLI 3.2.1.pre.beta.6 → 3.2.1.pre.beta.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +10 -0
- data/MuranoCLI.gemspec +37 -6
- data/Rakefile +38 -11
- data/lib/MrMurano/commands/business.rb +0 -4
- data/lib/MrMurano/version.rb +1 -1
- metadata +2 -251
- data/dockers/Dockerfile.2.2.9 +0 -40
- data/dockers/Dockerfile.2.3.6 +0 -40
- data/dockers/Dockerfile.2.4.3 +0 -40
- data/dockers/Dockerfile.2.5.0 +0 -40
- data/dockers/Dockerfile.GemRelease +0 -49
- data/dockers/Dockerfile.m4 +0 -122
- data/dockers/README.rst +0 -362
- data/dockers/RELEASE.rst +0 -135
- data/dockers/docker-test.sh +0 -163
- data/dockers/gem-release.sh +0 -4
- data/docs/basic_example.rst +0 -436
- data/docs/ci/.trustme.plugin +0 -140
- data/docs/ci/.trustme.sh +0 -516
- data/docs/ci/.trustme.vim +0 -55
- data/docs/completions/murano_completion-bash +0 -4484
- data/docs/demo.md +0 -109
- data/docs/develop.rst +0 -392
- data/docs/release.rst +0 -295
- data/spec/Account-Passwords_spec.rb +0 -245
- data/spec/Account_spec.rb +0 -256
- data/spec/Business_spec.rb +0 -307
- data/spec/ConfigFile_spec.rb +0 -55
- data/spec/ConfigMigrate_spec.rb +0 -108
- data/spec/Config_spec.rb +0 -440
- data/spec/Content_spec.rb +0 -422
- data/spec/GatewayBase_spec.rb +0 -65
- data/spec/GatewayDevice_spec.rb +0 -403
- data/spec/GatewayResource_spec.rb +0 -283
- data/spec/GatewaySettings_spec.rb +0 -130
- data/spec/HttpAuthed_spec.rb +0 -87
- data/spec/Http_spec.rb +0 -220
- data/spec/MakePretties_spec.rb +0 -127
- data/spec/Mock_spec.rb +0 -62
- data/spec/ProjectFile_spec.rb +0 -381
- data/spec/Setting_spec.rb +0 -120
- data/spec/Solution-ServiceConfig_spec.rb +0 -272
- data/spec/Solution-ServiceEventHandler_spec.rb +0 -442
- data/spec/Solution-ServiceModules_spec.rb +0 -562
- data/spec/Solution-UsersRoles_spec.rb +0 -269
- data/spec/Solution_spec.rb +0 -140
- data/spec/SyncRoot_spec.rb +0 -111
- data/spec/SyncUpDown_spec.rb +0 -868
- data/spec/Verbosing_spec.rb +0 -332
- data/spec/Webservice-Cors_spec.rb +0 -225
- data/spec/Webservice-Endpoint_spec.rb +0 -650
- data/spec/Webservice-File_spec.rb +0 -282
- data/spec/Webservice-Setting_spec.rb +0 -105
- data/spec/_workspace.rb +0 -43
- data/spec/cmd_business_spec.rb +0 -64
- data/spec/cmd_common.rb +0 -507
- data/spec/cmd_config_spec.rb +0 -73
- data/spec/cmd_content_spec.rb +0 -109
- data/spec/cmd_cors_spec.rb +0 -54
- data/spec/cmd_device_spec.rb +0 -130
- data/spec/cmd_domain_spec.rb +0 -62
- data/spec/cmd_element_spec.rb +0 -401
- data/spec/cmd_exchange_spec.rb +0 -114
- data/spec/cmd_help_spec.rb +0 -72
- data/spec/cmd_init_spec.rb +0 -475
- data/spec/cmd_keystore_spec.rb +0 -97
- data/spec/cmd_link_spec.rb +0 -105
- data/spec/cmd_logs_spec.rb +0 -162
- data/spec/cmd_password_spec.rb +0 -64
- data/spec/cmd_setting_application_spec.rb +0 -300
- data/spec/cmd_setting_product_spec.rb +0 -246
- data/spec/cmd_status_spec.rb +0 -300
- data/spec/cmd_syncdown_application_spec.rb +0 -128
- data/spec/cmd_syncdown_both_spec.rb +0 -178
- data/spec/cmd_syncdown_unit_spec.rb +0 -861
- data/spec/cmd_syncup_spec.rb +0 -148
- data/spec/cmd_token_spec.rb +0 -53
- data/spec/cmd_usage_spec.rb +0 -79
- data/spec/dry_run_formatter.rb +0 -28
- data/spec/fixtures/.mrmuranorc +0 -9
- data/spec/fixtures/ProjectFiles/invalid.yaml +0 -9
- data/spec/fixtures/ProjectFiles/only_meta.yaml +0 -24
- data/spec/fixtures/ProjectFiles/with_routes.yaml +0 -27
- data/spec/fixtures/SolutionFiles/0.2.0.json +0 -20
- data/spec/fixtures/SolutionFiles/0.2.0_invalid.json +0 -18
- data/spec/fixtures/SolutionFiles/0.2.json +0 -21
- data/spec/fixtures/SolutionFiles/0.3.0.json +0 -20
- data/spec/fixtures/SolutionFiles/0.3.0_invalid.json +0 -19
- data/spec/fixtures/SolutionFiles/0.3.json +0 -20
- data/spec/fixtures/SolutionFiles/basic.json +0 -20
- data/spec/fixtures/SolutionFiles/secret.json +0 -6
- data/spec/fixtures/configfile +0 -9
- data/spec/fixtures/dumped_config +0 -57
- data/spec/fixtures/exchange_element/element-show.json +0 -1
- data/spec/fixtures/exchange_element/swagger-mur-6407__10k.yaml +0 -282
- data/spec/fixtures/exchange_element/swagger-mur-6407__20k.yaml +0 -588
- data/spec/fixtures/gateway_resource_files/resources.notyaml +0 -12
- data/spec/fixtures/gateway_resource_files/resources.yaml +0 -13
- data/spec/fixtures/gateway_resource_files/resources_invalid.yaml +0 -13
- data/spec/fixtures/mrmuranorc_deleted_bob +0 -6
- data/spec/fixtures/mrmuranorc_tool_bob +0 -3
- data/spec/fixtures/product_spec_files/example.exoline.spec.yaml +0 -116
- data/spec/fixtures/product_spec_files/example.murano.spec.yaml +0 -14
- data/spec/fixtures/product_spec_files/gwe.exoline.spec.yaml +0 -21
- data/spec/fixtures/product_spec_files/gwe.murano.spec.yaml +0 -16
- data/spec/fixtures/product_spec_files/lightbulb-no-state.yaml +0 -11
- data/spec/fixtures/product_spec_files/lightbulb.yaml +0 -21
- data/spec/fixtures/roles-three.yaml +0 -11
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value 0.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value 1.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value No.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value Yes.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value bob.webmock +0 -72
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value false.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value off.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value on STDIN.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value on.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value true.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a json array blob with STDIN.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a json array blob.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) an array.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) appends an array.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting reads Webservice.cors to a file.webmock +0 -72
- data/spec/fixtures/snapshots/murano application setting reads Webservice.cors.webmock +0 -72
- data/spec/fixtures/snapshots/murano business list as json.webmock +0 -27
- data/spec/fixtures/snapshots/murano business list as table.webmock +0 -27
- data/spec/fixtures/snapshots/murano business list fewer fields.webmock +0 -27
- data/spec/fixtures/snapshots/murano business list only ids.webmock +0 -27
- data/spec/fixtures/snapshots/murano business list output to file.webmock +0 -27
- data/spec/fixtures/snapshots/murano business without project help.webmock +0 -9
- data/spec/fixtures/snapshots/murano config Needs a key.webmock +0 -9
- data/spec/fixtures/snapshots/murano config Reads a key.webmock +0 -9
- data/spec/fixtures/snapshots/murano config Removes a key.webmock +0 -9
- data/spec/fixtures/snapshots/murano config Sets a key.webmock +0 -9
- data/spec/fixtures/snapshots/murano config Sets a user key.webmock +0 -9
- data/spec/fixtures/snapshots/murano content life cycle.webmock +0 -144
- data/spec/fixtures/snapshots/murano cors sets CORS.webmock +0 -78
- data/spec/fixtures/snapshots/murano cors show CORS.webmock +0 -64
- data/spec/fixtures/snapshots/murano device activates.webmock +0 -86
- data/spec/fixtures/snapshots/murano device enables a batch.webmock +0 -76
- data/spec/fixtures/snapshots/murano device enables and lists.webmock +0 -78
- data/spec/fixtures/snapshots/murano device writes and reads.webmock +0 -136
- data/spec/fixtures/snapshots/murano domain show domain.webmock +0 -101
- data/spec/fixtures/snapshots/murano element edit unknown as unknown element.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show --help.webmock +0 -9
- data/spec/fixtures/snapshots/murano element show as csv.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show as default-table.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show as json.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show as table truncate.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show as table wrap.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show as yaml.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show using ambiguous name.webmock +0 -43
- data/spec/fixtures/snapshots/murano element without project usage.webmock +0 -9
- data/spec/fixtures/snapshots/murano exchange with project list as json.webmock +0 -59
- data/spec/fixtures/snapshots/murano exchange with project list as table.webmock +0 -59
- data/spec/fixtures/snapshots/murano exchange with project list fewer fields.webmock +0 -59
- data/spec/fixtures/snapshots/murano exchange with project list only ids.webmock +0 -59
- data/spec/fixtures/snapshots/murano exchange with project list output to file.webmock +0 -59
- data/spec/fixtures/snapshots/murano exchange with project list purchase is already added ID.webmock +0 -83
- data/spec/fixtures/snapshots/murano exchange with project list purchase is ambiguous name.webmock +0 -59
- data/spec/fixtures/snapshots/murano exchange without project help.webmock +0 -9
- data/spec/fixtures/snapshots/murano help using commander as --help.webmock +0 -9
- data/spec/fixtures/snapshots/murano help using commander no args.webmock +0 -9
- data/spec/fixtures/snapshots/murano help using subshell no args.webmock +0 -9
- data/spec/fixtures/snapshots/murano help using subshell with --help.webmock +0 -9
- data/spec/fixtures/snapshots/murano init Won't init in HOME (gracefully).webmock +0 -9
- data/spec/fixtures/snapshots/murano init in empty directory with existing project.webmock +0 -201
- data/spec/fixtures/snapshots/murano init in empty directory without existing project.webmock +0 -193
- data/spec/fixtures/snapshots/murano init in existing project directory with ProjectFile.webmock +0 -213
- data/spec/fixtures/snapshots/murano init in existing project directory with SolutionFile 0.2.0.webmock +0 -213
- data/spec/fixtures/snapshots/murano init in existing project directory with SolutionFile 0.3.0.webmock +0 -213
- data/spec/fixtures/snapshots/murano init in existing project directory without ProjectFile.webmock +0 -213
- data/spec/fixtures/snapshots/murano keystore can call other commands.webmock +0 -108
- data/spec/fixtures/snapshots/murano keystore clearAll.webmock +0 -124
- data/spec/fixtures/snapshots/murano keystore deletes.webmock +0 -112
- data/spec/fixtures/snapshots/murano keystore gets.webmock +0 -96
- data/spec/fixtures/snapshots/murano keystore infos.webmock +0 -96
- data/spec/fixtures/snapshots/murano keystore lists.webmock +0 -96
- data/spec/fixtures/snapshots/murano link with project links and lists.webmock +0 -149
- data/spec/fixtures/snapshots/murano link with project unlinks.webmock +0 -165
- data/spec/fixtures/snapshots/murano link without project help.webmock +0 -9
- data/spec/fixtures/snapshots/murano link without project subshell vs inline using commander will not list.webmock +0 -27
- data/spec/fixtures/snapshots/murano link without project subshell vs inline using subshell will not list.webmock +0 -27
- data/spec/fixtures/snapshots/murano logs when project is setup tail log.webmock +0 -9
- data/spec/fixtures/snapshots/murano password Lists when no file.webmock +0 -9
- data/spec/fixtures/snapshots/murano password deletes a password.webmock +0 -9
- data/spec/fixtures/snapshots/murano password sets a password.webmock +0 -9
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a forced string value on STDIN.webmock +0 -90
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a forced string value.webmock +0 -90
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a number value fiftyHalf.webmock +0 -64
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a number value float 12.67.webmock +0 -90
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a number value integer 12.webmock +0 -90
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a number value on STDIN.webmock +0 -90
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a string value.webmock +0 -90
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) merges into a dictionary.webmock +0 -90
- data/spec/fixtures/snapshots/murano single sync without ProjectFile syncdown.webmock +0 -322
- data/spec/fixtures/snapshots/murano status with ProjectFile status.webmock +0 -153
- data/spec/fixtures/snapshots/murano status with Solutionfile 0.2.0 status.webmock +0 -153
- data/spec/fixtures/snapshots/murano status with Solutionfile 0.3.0 status.webmock +0 -153
- data/spec/fixtures/snapshots/murano status without ProjectFile matches file path.webmock +0 -153
- data/spec/fixtures/snapshots/murano status without ProjectFile matches route.webmock +0 -153
- data/spec/fixtures/snapshots/murano status without ProjectFile status.webmock +0 -153
- data/spec/fixtures/snapshots/murano syncdown stubbed without ProjectFile syncdown.webmock +0 -151
- data/spec/fixtures/snapshots/murano syncdown without ProjectFile syncdown.webmock +0 -479
- data/spec/fixtures/snapshots/murano syncup without ProjectFile syncup.webmock +0 -357
- data/spec/fixtures/snapshots/murano token with project list as table.webmock +0 -9
- data/spec/fixtures/snapshots/murano token without project help.webmock +0 -9
- data/spec/fixtures/snapshots/murano usage show usage.webmock +0 -93
- data/spec/fixtures/syncable_conflict/services/devdata.lua +0 -18
- data/spec/fixtures/syncable_conflict/services/timers.lua +0 -4
- data/spec/fixtures/syncable_content/assets/icon.png +0 -0
- data/spec/fixtures/syncable_content/assets/index.html +0 -0
- data/spec/fixtures/syncable_content/assets/js/script.js +0 -0
- data/spec/fixtures/syncable_content/modules/table_util.lua +0 -58
- data/spec/fixtures/syncable_content/routes/manyRoutes.lua +0 -11
- data/spec/fixtures/syncable_content/routes/singleRoute.lua +0 -5
- data/spec/fixtures/websocket/README.rst +0 -110
- data/spec/fixtures/websocket/logs_blather.rb +0 -27
- data/spec/fixtures/websocket/logs_faker.rb +0 -153
- data/spec/fixtures/websocket/simple_connection.rb +0 -45
- data/spec/fixtures/websocket/simple_options.rb +0 -77
- data/spec/fixtures/websocket/simple_server.rb +0 -69
- data/spec/fixtures/websocket/wss-echo.rb +0 -48
- data/spec/fixtures/websocket/wss-fake-logs.rb +0 -20
- data/spec/spec_helper.rb +0 -131
- data/spec/variegated_TruthyFalsey_spec.rb +0 -29
- data/spec/webmock_snapshot.rb +0 -296
data/docs/demo.md
DELETED
@@ -1,109 +0,0 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
# Every sub-command will --help
|
4
|
-
|
5
|
-
# Start anew
|
6
|
-
- Clone project: `git clone https://github.com/tadpol/GWE-Multitool.git demo01`
|
7
|
-
- `cd demo01`
|
8
|
-
|
9
|
-
- Pick a business: `murano business list`
|
10
|
-
- Set it: `murano config business.id ZZZZZZZZZ`
|
11
|
-
|
12
|
-
- Create a product: `murano product create myawesomeproduct`
|
13
|
-
- Save the result: `murano config product.id YYYYYYYYY`
|
14
|
-
|
15
|
-
- Set the product definition: `murano config product.spec gwe-multitool.yaml`
|
16
|
-
- Set the directory to look for specs. `murano config location.specs spec`
|
17
|
-
- Sync the product definition up: `murano syncup -V --specs`
|
18
|
-
|
19
|
-
- Create an application: `murano application create myawesomesolution`
|
20
|
-
- Save the result: `murano config application.id XXXXXX`
|
21
|
-
- Assign the product to the application: `murano assign set`
|
22
|
-
|
23
|
-
# What got configured?
|
24
|
-
`murano config --dump`
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
# <voice type='orc'>Work Work</voice>
|
32
|
-
|
33
|
-
- What is going to change? `murano status`
|
34
|
-
- Sync solution code up: `murano syncup -V`
|
35
|
-
|
36
|
-
- Change a file
|
37
|
-
- What is going to change? `murano status`
|
38
|
-
- Details of change: `murano diff`
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
# Devices
|
44
|
-
- Add a real device: `murano product device enable 42:42:42:42:42:42`
|
45
|
-
- !!!cheat and activate by hand: `murano product device activate 42:42:42:42:42:42`
|
46
|
-
- Which resources are there? `murano pull --resources && cat specs/resources.yaml`
|
47
|
-
- What did the device write to that one resource?
|
48
|
-
`murano product device read 42:42:42:42:42:42 update_interval`
|
49
|
-
- `murano product device write 42:42:42:42:42:42 update_interval 300`
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
# Multiple configs
|
54
|
-
Because Developing, Staging, Production.
|
55
|
-
|
56
|
-
Set addition config file to load with `MR_CONFIGFILE`
|
57
|
-
|
58
|
-
Also supports '.env'
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
# Device Content Area
|
64
|
-
|
65
|
-
See GWE.
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
# Debugging
|
72
|
-
|
73
|
-
## Logs
|
74
|
-
- `murano logs`
|
75
|
-
- `murano logs --follow`
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
## Keystore
|
83
|
-
### What is in the Keystore?
|
84
|
-
`murano keystore list`
|
85
|
-
|
86
|
-
### Write and Read a Key
|
87
|
-
- `murano keystore set test greebled`
|
88
|
-
- `murano keystore get test`
|
89
|
-
|
90
|
-
### Write to a Set
|
91
|
-
- `murano keystore command sadd myset greebled`
|
92
|
-
Or any other supported Redis command.
|
93
|
-
|
94
|
-
### Remove just the ones with 'socketmap'
|
95
|
-
`murano keystore list | grep socketmap | xargs -L1 murano keystore delete`
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
## TSDB
|
101
|
-
|
102
|
-
- `murano tsdb list metrics`
|
103
|
-
- `murano tsdb list tags`
|
104
|
-
- `murano tsdb query @sn=1 temp0`
|
105
|
-
- `murano tsdb query @sn=1 temp0 --limit=4`
|
106
|
-
- `murano tsdb query @sn=1 --limit=10 -c outformat=csv --epoch ms`
|
107
|
-
|
108
|
-
|
109
|
-
|
data/docs/develop.rst
DELETED
@@ -1,392 +0,0 @@
|
|
1
|
-
#########################
|
2
|
-
MuranoCLI Developer Guide
|
3
|
-
#########################
|
4
|
-
|
5
|
-
=========================
|
6
|
-
Introduction to MuranoCLI
|
7
|
-
=========================
|
8
|
-
|
9
|
-
Login example
|
10
|
-
-------------
|
11
|
-
|
12
|
-
Use MuranoCLI to logon for the first time.::
|
13
|
-
|
14
|
-
$ murano login
|
15
|
-
No Murano user account found; please login
|
16
|
-
User name: user@domain.tld
|
17
|
-
Couldn't find password for user@domain.tld
|
18
|
-
Password: XXXX
|
19
|
-
|
20
|
-
MuranoCLI creates two files in your home directory.::
|
21
|
-
|
22
|
-
$ cat ~/.murano/config
|
23
|
-
[user]
|
24
|
-
name = user@domain.tld
|
25
|
-
|
26
|
-
$ cat ~/.murano/passwords
|
27
|
-
---
|
28
|
-
bizapi.hosted.exosite.io:
|
29
|
-
user@domain.tld: "XXXXXXXXXXXXXXXX"
|
30
|
-
|
31
|
-
$ murano login --show-token
|
32
|
-
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
33
|
-
|
34
|
-
Create a business
|
35
|
-
-----------------
|
36
|
-
|
37
|
-
FIXME: Show the ``murano init`` command.
|
38
|
-
|
39
|
-
Work on a business
|
40
|
-
------------------
|
41
|
-
|
42
|
-
View a list of businesses you've created.::
|
43
|
-
|
44
|
-
$ murano business list
|
45
|
-
+------------------+-------+--------------------+
|
46
|
-
| bizid | role | name |
|
47
|
-
+------------------+-------+--------------------+
|
48
|
-
| abcdef1234567890 | owner | Business Name |
|
49
|
-
| 1234567890abcdef | admin | ACME IoT |
|
50
|
-
+------------------+-------+--------------------+
|
51
|
-
|
52
|
-
Pick a business to work on.::
|
53
|
-
|
54
|
-
# From the `murano business list` list:
|
55
|
-
$ murano config business.id abcdef1234567890
|
56
|
-
|
57
|
-
MuranoCLI will remember the business you've chosen.::
|
58
|
-
|
59
|
-
$ cat /exo/clients/exosite/.murano/config
|
60
|
-
[business]
|
61
|
-
id = ct7rmoz3hu34ygb9
|
62
|
-
|
63
|
-
MuranoCLI options
|
64
|
-
-----------------
|
65
|
-
|
66
|
-
To see all options that MuranoCLI *really* supports, make a dump.
|
67
|
-
|
68
|
-
.. code-block:: bash
|
69
|
-
|
70
|
-
$ murano config --dump
|
71
|
-
|
72
|
-
[tool]
|
73
|
-
verbose = false
|
74
|
-
debug = false
|
75
|
-
...
|
76
|
-
|
77
|
-
============================
|
78
|
-
Developer Setup Instructions
|
79
|
-
============================
|
80
|
-
|
81
|
-
Fork and clone the project
|
82
|
-
--------------------------
|
83
|
-
|
84
|
-
Fork the project into your account. Visit:
|
85
|
-
|
86
|
-
https://github.com/exosite/MuranoCLI.git
|
87
|
-
|
88
|
-
After forking, clone your repo and set its upstream.
|
89
|
-
|
90
|
-
NOTE: This guide assumes you are working out of the directory,
|
91
|
-
``/exo/clients/exosite``.
|
92
|
-
|
93
|
-
.. code-block:: bash
|
94
|
-
|
95
|
-
cd /exo/clients/exosite
|
96
|
-
|
97
|
-
git clone git@github.com:{username}/MuranoCLI.git
|
98
|
-
|
99
|
-
cd MuranoCLI
|
100
|
-
|
101
|
-
git remote add upstream git@github.com:exosite/MuranoCLI.git
|
102
|
-
# Add other developers' repos. E.g.,
|
103
|
-
git remote add tadpol git@github.com:tadpol/MuranoCLI.git
|
104
|
-
git remote add landonb git@github.com:landonb/MuranoCLI.git
|
105
|
-
|
106
|
-
Checkout a branch
|
107
|
-
-----------------
|
108
|
-
|
109
|
-
Checkout an existing branch...
|
110
|
-
|
111
|
-
.. code-block:: bash
|
112
|
-
|
113
|
-
git checkout feature/ticket_name_and_number
|
114
|
-
|
115
|
-
... or create a new branch.
|
116
|
-
|
117
|
-
.. code-block:: bash
|
118
|
-
|
119
|
-
# Create a new topic branch.
|
120
|
-
git checkout -b feature/totally_awesome
|
121
|
-
# Push the new topic branch and setup remote tracking [-u].
|
122
|
-
git push -u origin feature/totally_awesome
|
123
|
-
|
124
|
-
Rebase when merging co-workers' changes
|
125
|
-
---------------------------------------
|
126
|
-
|
127
|
-
While working on your branch, you'll want to periodically grab
|
128
|
-
changes from other folks. So long as you're the only one working
|
129
|
-
on your branch, rebase your work to keep the git history sane.
|
130
|
-
|
131
|
-
.. code-block:: bash
|
132
|
-
|
133
|
-
git fetch upstream
|
134
|
-
git checkout feature/murcli
|
135
|
-
git rebase upstream/feature/okami
|
136
|
-
git push origin feature/murcli
|
137
|
-
|
138
|
-
NOTE: Do not rebase onto a branch being actively worked on by
|
139
|
-
other people, like ``master`` or ``develop``, or you'll screw
|
140
|
-
up everybody's histories and force people to clone anew.
|
141
|
-
|
142
|
-
Beware of Ruby Version Management
|
143
|
-
---------------------------------
|
144
|
-
|
145
|
-
To build and run the code, you might be able to run whatever
|
146
|
-
ruby is currently installed. But you'll probably eventually
|
147
|
-
run into problems with different ruby projects using different
|
148
|
-
versions of different libraries. So you'll probably want to
|
149
|
-
use a ruby version manager, such as
|
150
|
-
`Ruby Version Manager <https://rvm.io/>`__,
|
151
|
-
or `chruby <https://github.com/postmodern/chruby>`__
|
152
|
-
or `rbenv <https://github.com/rbenv/rbenv>`__.
|
153
|
-
|
154
|
-
- If you're having problems building or running MuranoCLI,
|
155
|
-
``gem env`` is a good way to see how the ruby environment
|
156
|
-
variables are set.
|
157
|
-
|
158
|
-
- One important setting to check is the gem directory.
|
159
|
-
This should be somewhere writable by your user, like $HOME.
|
160
|
-
E.g.,
|
161
|
-
|
162
|
-
``$ ruby -rubygems -e 'puts Gem.user_dir'``
|
163
|
-
|
164
|
-
``/home/user/.gem/ruby/2.3.0``
|
165
|
-
|
166
|
-
- Other interesting environs:
|
167
|
-
|
168
|
-
``GEM_HOME``, ``GEM_PATH``, and ``GEM_ROOT``.
|
169
|
-
|
170
|
-
Example ``chruby`` usage
|
171
|
-
^^^^^^^^^^^^^^^^^^^^^^^^
|
172
|
-
|
173
|
-
If you use ``chruby``, tell it what version of ruby you want:
|
174
|
-
|
175
|
-
.. code-block:: bash
|
176
|
-
|
177
|
-
cd /path/to/MuranoCLI
|
178
|
-
echo "ruby-2.3" > .ruby-version
|
179
|
-
|
180
|
-
(You can also do this for ``rvm``, which recognizes the
|
181
|
-
same ``.ruby-version`` files.)
|
182
|
-
|
183
|
-
Now tell chruby to load the version of ruby you want:
|
184
|
-
|
185
|
-
.. code-block:: bash
|
186
|
-
|
187
|
-
cd /path/to/MuranoCLI
|
188
|
-
chruby $(cat .ruby-version)
|
189
|
-
|
190
|
-
Install dependencies
|
191
|
-
--------------------
|
192
|
-
|
193
|
-
To install the project, you'll need
|
194
|
-
`bundler
|
195
|
-
<https://github.com/bundler/bundler>`__.
|
196
|
-
|
197
|
-
Run these commands once from any directory:
|
198
|
-
|
199
|
-
.. code-block:: bash
|
200
|
-
|
201
|
-
gem install bundler
|
202
|
-
|
203
|
-
gem install rspec
|
204
|
-
|
205
|
-
gem install byebug
|
206
|
-
|
207
|
-
gem install rubocop
|
208
|
-
|
209
|
-
Prepare MuranoCLI
|
210
|
-
-----------------
|
211
|
-
|
212
|
-
Install the gems listed in the MuranoCLI Gemfile:
|
213
|
-
|
214
|
-
.. code-block:: bash
|
215
|
-
|
216
|
-
cd /path/to/MuranoCLI
|
217
|
-
bundle install --path $(ruby -rubygems -e 'puts Gem.dir') --with test
|
218
|
-
|
219
|
-
Build and Install MuranoCLI
|
220
|
-
---------------------------
|
221
|
-
|
222
|
-
Build and install the Gem locally to your local gem directory.
|
223
|
-
|
224
|
-
.. code-block:: bash
|
225
|
-
|
226
|
-
cd /path/to/MuranoCLI
|
227
|
-
|
228
|
-
rake install:user
|
229
|
-
|
230
|
-
Verify that it installed.
|
231
|
-
|
232
|
-
.. code-block:: bash
|
233
|
-
|
234
|
-
murano -v
|
235
|
-
|
236
|
-
Troubleshooting: check that ``murano`` doesn't reference something else.
|
237
|
-
|
238
|
-
.. code-block:: bash
|
239
|
-
|
240
|
-
command -v murano
|
241
|
-
|
242
|
-
Prepare to Test
|
243
|
-
---------------
|
244
|
-
|
245
|
-
Create Config File
|
246
|
-
^^^^^^^^^^^^^^^^^^
|
247
|
-
|
248
|
-
So the tests know what Business to use, setup a config file.
|
249
|
-
|
250
|
-
([lb] also likes to see what ``murano`` and ``curl`` calls happen,
|
251
|
-
so I enable ``curldebug`` and redirect the verbose output to a file,
|
252
|
-
``curlfile``.)
|
253
|
-
|
254
|
-
::
|
255
|
-
|
256
|
-
[user]
|
257
|
-
name = user@exosite.com
|
258
|
-
|
259
|
-
[net]
|
260
|
-
host = bizapi.hosted.exosite.io
|
261
|
-
|
262
|
-
[business]
|
263
|
-
id = xxxxxxxxxxxxxxxx
|
264
|
-
|
265
|
-
[tool]
|
266
|
-
developer = true
|
267
|
-
no-page = true
|
268
|
-
curlfile = "/path/to/MuranoCLI/curldebug.out"
|
269
|
-
curldebug = true
|
270
|
-
curlfancy = true
|
271
|
-
|
272
|
-
Save the file outside the MuranoCLI repo, e.g., to
|
273
|
-
``/exo/clients/exosite/.murano.test``
|
274
|
-
|
275
|
-
Set Environs
|
276
|
-
^^^^^^^^^^^^
|
277
|
-
|
278
|
-
You'll need to setup a few environs first.
|
279
|
-
|
280
|
-
You could simply export the values explicitly::
|
281
|
-
|
282
|
-
export MURANO_CONFIGFILE="/exo/clients/exosite/.murano.test"
|
283
|
-
export MURANO_PASSWORD="XXXXXXXXXXXXXXXX"
|
284
|
-
|
285
|
-
Or you could do something fancier using MuranoCLI to find them, e.g.,::
|
286
|
-
|
287
|
-
cat > test-murano.sh << EOF
|
288
|
-
cat #!/bin/bash
|
289
|
-
export MURANO_CONFIGFILE="$(pwd)/.murano.test"
|
290
|
-
MURANO_USER=`murano password current`
|
291
|
-
MURANO_HOST=`murano config net.host`
|
292
|
-
export MURANO_PASSWORD=`ruby -ryaml -e "puts YAML.load_file(File.join(Dir.home,'.murano','passwords'))['$MURANO_HOST']['$MURANO_USER']"`
|
293
|
-
echo "Testing using ${MURANO_USER}@${MURANO_HOST} with PWD ${MURANO_PASSWORD} and CFG ${MURANO_CONFIGFILE}"
|
294
|
-
rspec "$@"
|
295
|
-
EOF
|
296
|
-
|
297
|
-
chmod 755 test-murano.sh
|
298
|
-
./test-murano.sh
|
299
|
-
|
300
|
-
Cleanup Solutions
|
301
|
-
^^^^^^^^^^^^^^^^^
|
302
|
-
|
303
|
-
Before running tests, or if tests are interrupted, delete all solutions
|
304
|
-
under your business.
|
305
|
-
|
306
|
-
.. code-block:: bash
|
307
|
-
|
308
|
-
cd /path/to/MuranoCLI
|
309
|
-
|
310
|
-
rake test_clean_up
|
311
|
-
|
312
|
-
Run Tests
|
313
|
-
---------
|
314
|
-
|
315
|
-
Run All Rspec Tests
|
316
|
-
^^^^^^^^^^^^^^^^^^^
|
317
|
-
|
318
|
-
.. code-block:: bash
|
319
|
-
|
320
|
-
rspec
|
321
|
-
|
322
|
-
Run Single Rspec Test
|
323
|
-
^^^^^^^^^^^^^^^^^^^^^
|
324
|
-
|
325
|
-
E.g.,
|
326
|
-
|
327
|
-
.. code-block:: bash
|
328
|
-
|
329
|
-
rspec ./spec/cmd_syncup_spec.rb
|
330
|
-
|
331
|
-
Run Tagged Rspec Test
|
332
|
-
^^^^^^^^^^^^^^^^^^^^^
|
333
|
-
|
334
|
-
The test might look like::
|
335
|
-
|
336
|
-
it "status", :not_in_okami do
|
337
|
-
|
338
|
-
And running it would look like::
|
339
|
-
|
340
|
-
rspec --tag '~not_in_okami' ./spec/cmd_syncup_spec.rb
|
341
|
-
|
342
|
-
Run Specific "Example" from Rspec Test
|
343
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
344
|
-
|
345
|
-
Run just one test within a file.
|
346
|
-
|
347
|
-
The test file might look like::
|
348
|
-
|
349
|
-
RSpec.describe 'murano status', :cmd, :needs_password do
|
350
|
-
...
|
351
|
-
context "with ProjectFile" do
|
352
|
-
...
|
353
|
-
it "status" do
|
354
|
-
...
|
355
|
-
|
356
|
-
And you could run just that test with::
|
357
|
-
|
358
|
-
rspec ./spec/cmd_status_spec.rb -e "murano status with ProjectFile status"
|
359
|
-
|
360
|
-
Run All Tests and Capture Colorful Output to HTML
|
361
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
362
|
-
|
363
|
-
.. code-block:: bash
|
364
|
-
|
365
|
-
sudo apt-get install aha
|
366
|
-
|
367
|
-
rspec --format html \
|
368
|
-
--out report/index-$( \
|
369
|
-
ruby -e 'require "/path/to/MuranoCLI/lib/MrMurano/version.rb"; \
|
370
|
-
puts MrMurano::VERSION').html
|
371
|
-
--format documentation \
|
372
|
-
--tag '~not_in_okami' \
|
373
|
-
| aha --black > MuranoCLI.rspec.html
|
374
|
-
|
375
|
-
Rerun Failing Tests
|
376
|
-
^^^^^^^^^^^^^^^^^^^
|
377
|
-
|
378
|
-
.. code-block:: bash
|
379
|
-
|
380
|
-
rspec --tag '~not_in_okami' --only-failures
|
381
|
-
|
382
|
-
Uninstall MuranoCLI
|
383
|
-
-------------------
|
384
|
-
|
385
|
-
E.g.,
|
386
|
-
|
387
|
-
.. code-block:: bash
|
388
|
-
|
389
|
-
gem uninstall MuranoCLI --version 3.0.0.alpha.2
|
390
|
-
|
391
|
-
gem uninstall MuranoCLI --version 2.2.4.alpha
|
392
|
-
|