cyclid-client 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4f3103e6192e785783253bd4744d5fefde54c471
4
+ data.tar.gz: 58611514dcc9507b34c1ee53c3f52f51fd3f64db
5
+ SHA512:
6
+ metadata.gz: d10e93e81811d9f6dd166a30d5eab0f412290e07ee2e2352988a56f3236643228cdec00cf9ee1b10ab86401fd5eac6d98f87ec2319cf28b73ba3e22827c90bcd
7
+ data.tar.gz: bc391dda6f72d28fa9f64dc766f1284d2fd991d8e7bd0d8997c824cb8706fc0e6e67432582dcc70f17820004a482df7ca579c49706d32c35e72b6ad48dd1421e
data/LICENSE ADDED
@@ -0,0 +1,174 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
data/README.md ADDED
@@ -0,0 +1,587 @@
1
+ # Cyclid client
2
+
3
+ Note that the client is still in development. Some features are missing
4
+ entirely and the interface is liable to change at any moment.
5
+
6
+ ## Contents
7
+
8
+ * [Installation](#installation)
9
+ * [Configuration](#configuration)
10
+ * [Configuration file format](#configuration-file-format)
11
+ * [Example](#example)
12
+ * [Switching between configurations](#switching-between-configurations)
13
+ * [Specifying a configuration file](#specifying-a-configuration-file)
14
+ * [Commands](#commands)
15
+ * [User commands](#user-commands)
16
+ * [user show](#user-show)
17
+ * [user passwd](#user-passwd)
18
+ * [user modify](#user-modify)
19
+ * [Organization commands](#organization-commands)
20
+ * [organization list](#organization-list)
21
+ * [organization show](#organization-show)
22
+ * [organization use](#organization-use)
23
+ * [organization modify](#organization-modify)
24
+ * [organization member](#organization-member)
25
+ * [organization member list](#organization-member-list)
26
+ * [organization member show](#organization-member-show)
27
+ * [organization member add](#organization-member-add)
28
+ * [organization member permission](#organization-member-permission)
29
+ * [organization member remove](#organization-member-remove)
30
+ * [organization config](#organization-config)
31
+ * [organization config show](#organization-config-show)
32
+ * [organization config edit](#organization-config-edit)
33
+ * [Job commands](#job-commands)
34
+ * [job show](#job-show)
35
+ * [job status](#job-status)
36
+ * [job log](#job-log)
37
+ * [job submit](#job-submit)
38
+ * [Stage commands](#stage-commands)
39
+ * [stage list](#stage-list)
40
+ * [stage show](#stage-show)
41
+ * [stage create](#stage-create)
42
+ * [stage edit](#stage-edit)
43
+ * [Secret commands](#secret-commands)
44
+ * [secret encrypt](#secret-encrypt)
45
+ * [Admin commands](#admin-commands)
46
+ * [admin organization list](#admin-organization-list)
47
+ * [admin organization show](#admin-organization-show)
48
+ * [admin organization create](#admin-organization-create)
49
+ * [admin organization modify](#admin-organization-modify)
50
+ * [admin organization delete](#admin-organization-delete)
51
+ * [admin user list](#admin-user-list)
52
+ * [admin user show](#admin-user-show)
53
+ * [admin user create](#admin-user-create)
54
+ * [admin user passwd](#admin-user-passwd)
55
+ * [admin user modify](#admin-user-modify)
56
+ * [admin user delete](#admin-user-delete)
57
+
58
+ Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc.go)
59
+
60
+ ## Installation
61
+
62
+ $ gem install cyclid-client -s http://rubygems.cyclid.io
63
+
64
+ ## Configuration
65
+
66
+ ### Configuration file format
67
+
68
+ The configuration file is a simple YAML file with only five options.
69
+
70
+ | Option|Required?|Description|
71
+ |---|---|---|
72
+ |server|Required|The hostname of the Cyclid server.|
73
+ |port|Optional|The port to use for connections to the Cyclid server.|
74
+ |organization|Required|The organization name.|
75
+ |username|Required|The username that is associated with the organization.|
76
+ |secret|Required|The HMAC signing secret for the user.|
77
+
78
+ #### Example
79
+
80
+ server: cyclid.example.com
81
+ organization: my_organization
82
+ username: user
83
+ secret: b1fc42ef648b4407f30dc77f328dbb86b03121fb15aba256497ef97ec9a3cd02
84
+
85
+ ### Switching between configurations
86
+
87
+ The client uses configuration files under `$HOME/.cyclid` You can have
88
+ multiple configuration files and switch between the with the
89
+ `organization use` command.
90
+
91
+ For example, of your user belongs to two organizations, you can have one
92
+ configuration file for each organization E.g.
93
+
94
+ $HOME/.cyclid/organization_one
95
+ $HOME/.cyclid/organization_two
96
+
97
+ and then use the command `cyclid organization use organization_one` to select
98
+ it as the current configuration.
99
+
100
+ To find the list of available configurations, use the `organization list`
101
+ command.
102
+
103
+ ### Specifying a configuration file
104
+
105
+ You can use the `--config` or `-c` option to specify the path to a configuration file to use instead of the current configuration that has been set with the `organization use` command.
106
+
107
+ ## Commands
108
+
109
+ Cyclid commands are grouped under the following categories:
110
+
111
+ |Group|Description|
112
+ |---|---|
113
+ |user|Manage your current user|
114
+ |organization|Manage your current organization|
115
+ |job|Manage and submit jobs|
116
+ |stage|Manage stage definitions|
117
+ |secret|Create secrets|
118
+ |admin|Administrator commands|
119
+
120
+ ### User commands
121
+
122
+ #### user show
123
+
124
+ Display your current user details.
125
+
126
+ $ cyclid user show
127
+ Username: bob
128
+ Email: bob@example.com
129
+ Organizations
130
+ example
131
+
132
+ #### user passwd
133
+
134
+ Change your current users password. The user password is only used for HTTP Basic authentication.
135
+
136
+ $ cyclid user passwd
137
+ Password: <enter new password>
138
+ Confirm password: <re-enter new password>
139
+
140
+ #### user modify
141
+
142
+ Change your current users email address, HMAC secret and/or password. You can pass the following options:
143
+
144
+ |Option|Short option|Description|
145
+ |---|---|---|
146
+ |--email|-e|Change your email address|
147
+ |--secret|-s|Change your HMAC secret|
148
+ |--password|-p|Change your email address|
149
+
150
+ Unlike the interactive `user passwd` command you can use `user modify` and pass your new password on the command line.
151
+
152
+ Your HMAC secret should ideally be a suitably long (at least 256 bit) and random string, which you should keep secure in your Cyclid configuration file. After changing your HMAC secret you will need to update your configuration file with the new secret before you can run any other Cyclid commands.
153
+
154
+ # Change your email
155
+ $ cyclid user modify --email robert@example.com
156
+ # Change your HMAC secret
157
+ $ cyclid user modify --secret b072d8b51cec2755145c401b9249a60ebd89b4704eeebc5b6805ba682d7fac53
158
+
159
+ ### Organization commands
160
+
161
+ #### organization list
162
+
163
+ Lists all of the available organization configurations on your local machine.
164
+
165
+ $ cyclid org list
166
+ admins
167
+ Server: http://example.com
168
+ Organization: admins
169
+ Username: admin
170
+ example
171
+ Server: http://example.com
172
+ Organization: example
173
+ Username: bob
174
+
175
+ #### organization show
176
+
177
+ Display the details of your currently selected organization, including the list of organization members and its public key.
178
+
179
+ $ cyclid org show
180
+ Name: example
181
+ Owner Email: bob@example.com
182
+ Public Key: -----BEGIN PUBLIC KEY-----
183
+ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8P8CMCfYLqMfAGq/pWyV
184
+ r92w8TMo3A5Irf1iZsFko42WGgIdOAnDuguODUFIzWmyrKm1WL0+V403j914gCRL
185
+ 8Zi+To3qbQtLaD4etiP/p3Z6qEHt77rn67kRxKjpcyiHkwOtQxMO5VCXlYCvEnDz
186
+ 0Rn2cq9VutrjrZcOjNCk7AkUtTZ3arkntYPaNBtPDpQz1x3dGdumSgVBUx1dcaqE
187
+ khLVc1SB1mqPNcIKoqIQF5oNGBdNWA6oBxk5CNj1GfpXayawixjgvq+tkJo3mDbu
188
+ F6UzJ4UGzbpC3EYqCkEByNOXv4J2aYaOjChFUiHn1XcSUVZHkrzFcb47Pif1wshi
189
+ lwIDAQAB
190
+ -----END PUBLIC KEY-----
191
+ Members:
192
+ bob
193
+ lucy
194
+ dave
195
+ leslie
196
+
197
+ #### organization use
198
+
199
+ Select an organization configuration to use by default. Pass a name of an organization from `organization list` to select it as your current configuration. If you do not pass a new organization name, the name of the currently selected organization is shown.
200
+
201
+ # Show the currently selected organization
202
+ $ cyclid organization use
203
+ example
204
+ # Select the 'admins' organization
205
+ $ cyclid organization use admins
206
+
207
+ #### organization modify
208
+
209
+ Modify the current organization. This command can only be used by organization admins.
210
+
211
+ You can pass the following options:
212
+
213
+ |Option|Short option|Description|
214
+ |---|---|---|
215
+ |--email|-e|Change the owner email address|
216
+
217
+ # Change the organization owner email address
218
+ $ cyclid organization modify --email lucy@example.com
219
+
220
+ #### organization member
221
+
222
+ The `organization member` command has a series of sub-commands which are used to manage users which belong to the organization.
223
+
224
+ ##### organization member list
225
+
226
+ List all of the users who are members of the current organization.
227
+
228
+ $ cyclid organization member list
229
+ bob
230
+ lucy
231
+ dave
232
+ leslie
233
+
234
+ ##### organization member show
235
+
236
+ Display the user details of an organization member, including the user permissions.
237
+
238
+ $ cyclid organization member show bob
239
+ Username: bob
240
+ Email: bob@example.com
241
+ Permissions
242
+ Admin: false
243
+ Write: true
244
+ Read: true
245
+
246
+ ##### organization member add
247
+
248
+ Add user(s) to the current organization. You must pass at least one username.
249
+
250
+ Users are added without any permissions set. You can use the `organization member permission` command to modify the user permissions after they have been added to the organization.
251
+
252
+ # Add a single user, 'bob', to the organization
253
+ $ cyclid organization member add bob
254
+ # Add multiple users, 'bob' and 'lucy', to the organization
255
+ $ cyclid organization member add bob lucy
256
+
257
+ ##### organization member permission
258
+
259
+ Modify a users permissions for the organization. You must pass the username and the level of access you want the user to have. This can be one of:
260
+
261
+ * admin
262
+ * write
263
+ * read
264
+ * none
265
+
266
+ The 'admin' permission implies 'write', and the 'write' permission implies 'read'.
267
+
268
+ With 'none' the user remains an organization member but can not interact with it. See the `organization member remove` command if you want to actually remove a user from the organization.
269
+
270
+ # Give the user 'bob' read-only access to the organization
271
+ $ cyclid organization member permission bob read
272
+ # Give the user 'lucy' admin permissions for the organization
273
+ $ cyclid organization member permission lucy admin
274
+
275
+ ##### organization member remove
276
+
277
+ Remove user(s) from the current organization. You must pass at least one username. By default the `organization member remove` command will ask you to confirm the removal first; you can over-ride this with the `--force/-f` option to force removal without confirmation.
278
+
279
+ |Option|Short option|Description|
280
+ |---|---|---|
281
+ |--force|-f|Do not ask for confirmation before removing the user|
282
+
283
+ # Remove the user 'bob' from the organization without asking for confirmation
284
+ $ cyclid organization member remove bob --force
285
+
286
+ #### organization config
287
+
288
+ The `organization config` command has a series of sub-commands which are used to get and set plugin configurations for your organization.
289
+
290
+ ##### organization config show
291
+
292
+ Show the current organization specific configuration for a plugin. You must specify both the plugin type, and the plugin name.
293
+
294
+ # Show the current configuration for the Github API plugin
295
+ $ cyclid organization config show api github
296
+ Repository OAuth tokens
297
+ None
298
+ Github HMAC signing secret: Not set
299
+
300
+ ##### organization config edit
301
+
302
+ Modify the organization specific configuration for a plugin. You must specify both the plugin type, and the plugin name.
303
+
304
+ The `config edit` command expects the `$EDITOR` environment variable to be set to the path of a valid text editor that it can start.
305
+
306
+ $ cyclid organization config edit api github
307
+ # The Github plugin configuration is loaded in your text editor
308
+
309
+ ### Job commands
310
+
311
+ #### job show
312
+
313
+ Show the details of a job. You must pass a valid job ID.
314
+
315
+ $ cyclid job show 7
316
+ Job: 7
317
+ Name: test_job
318
+ Version: 1.0.0
319
+ Started: Thu Apr 21 16:40:57 2016
320
+ Ended: Thu Apr 21 16:41:04 2016
321
+ Status: Succeeded
322
+
323
+ #### job status
324
+
325
+ Show the status of a job. You must pass a valid job ID.
326
+
327
+ $ cyclid job status 7
328
+ Status: Succeeded
329
+
330
+ #### job log
331
+
332
+ Show the log from a job. You must pass a valid job ID.
333
+
334
+ $ cylid job log 7
335
+ 2016-04-21 16:40:57 +0100 : Obtaining build host...
336
+ 2016-04-21 16:41:47 +0100 : Preparing build host...
337
+ ===============================================================================
338
+ 2016-04-21 16:41:47 +0100 : Job started. Context: {"job_id"=>7, "job_name"=>"test_job", "job_version"=>"1.0.0", "organization"=>"example", "os"=>"ubuntu_trusty", "name"=>"mist-3c04c6134a3f776cbe8e91e396d4dace", "host"=>"192.168.1.247", "username"=>"build", "workspace"=>"/home/build", "password"=>nil, "key"=>"~/.ssh/id_rsa_build", "server"=>"build01", "distro"=>"ubuntu", "release"=>"trusty"}
339
+ -------------------------------------------------------------------------------
340
+ 2016-04-21 16:41:47 +0100 : Running stage example v1.0.0
341
+ ...
342
+
343
+ #### job submit
344
+
345
+ Submit a Cyclid job file to be run. The `job submit` command expects to be passed a path to a valid Cyclid job file in either JSON or YAML format.
346
+
347
+ The `job submit` command will attempt to automatically detect the format of the job file. You can use the `--json/-j` or `--yaml/-y` options to over-ride the format detection.
348
+
349
+ The job ID for the job will be shown once the job has been submitted. You can then check the status of the job with the `job status`, `job show` and `job log` commands.
350
+
351
+ |Option|Short option|Description|
352
+ |---|---|---|
353
+ |--json|-j|Parse the file as JSON|
354
+ |--yaml|-y|Parse the file as YAML|
355
+
356
+ $ cyclid job submit job.yml
357
+ Job: 8
358
+
359
+ ### Stage commands
360
+
361
+ #### stage list
362
+
363
+ List all of the stages, and each version of each stage, that are defined for the organization.
364
+
365
+ $ cyclid stage list
366
+ example v0.0.1
367
+ example v0.0.2
368
+ example v0.1.0
369
+ success v1.0.0
370
+ success v1.0.1
371
+ failure v1.0.0
372
+
373
+ #### stage show
374
+
375
+ Show the details of a stage.
376
+
377
+ $ cyclid stage show example
378
+ Name: example
379
+ Version: 0.0.1
380
+ Steps
381
+ Action: command
382
+ Cmd: echo
383
+ Args: ["'hello", "world'"]
384
+ Name: example
385
+ Version: 0.0.2
386
+ Steps
387
+ Action: command
388
+ Cmd: echo
389
+ Args: ["'hello", "world'"]
390
+ Name: example
391
+ Version: 0.1.0
392
+ Steps
393
+ Action: command
394
+ Cmd: echo
395
+ Args: ["'Hello", "universe'"]
396
+
397
+ #### stage create
398
+
399
+ Create a new stage, or a new version of a stage, from a stage definition in a file. The `stage create` command expects to be passed a path to a valid Cyclid stage definition file in either JSON or YAML format.
400
+
401
+ The `stage create` command will attempt to automatically detect the format of the stage file. You can use the `--json/-j` or `--yaml/-y` options to over-ride the format detection.
402
+
403
+ |Option|Short option|Description|
404
+ |---|---|---|
405
+ |--json|-j|Parse the file as JSON|
406
+ |--yaml|-y|Parse the file as YAML|
407
+
408
+ $ cyclid stage create stage.yml
409
+
410
+ #### stage edit
411
+
412
+ Edit a stage definition that exists on the server. Note that individual versions of a stage are immutable; once a version of a stage has been created it can not be deleted or modified. However, you can create a new version.
413
+
414
+ If you attempt to create a stage with the same name & version of an existing stage, the command will fail.
415
+
416
+ The `stage edit` command expects the `$EDITOR` environment variable to be set to the path of a valid text editor that it can start.
417
+
418
+ $ cyclid stage edit example
419
+ # The 'example' stage definition is loaded in your text editor
420
+
421
+ ### Secret commands
422
+
423
+ #### secret encrypt
424
+
425
+ Encrypts a string with the organizations public key. You can then add the encrypted secret to the `secrets` section of a Cyclid job definition.
426
+
427
+ $ cyclid secret encrypt
428
+ Secret: <Enter the secret to be encrypted>
429
+ Secret: uzegcZfXPuj4KNo+EpP928cgPW37gMDhdKw9OoCE0YXKWWtJ+kJIHzLyOGrF7p6dDJ3cWNZhEDADINJqsYMoaSbSAdT5Gx+lAo7BWOP+y20j9ECLyktfmhBi7mdxg66URcEe/VnD9JN9OObwGTaycb1XryZWeU/Hfr45Y/HObUnFhE+W+IHbAswMBO9bs3DogF672DFXkTtt+b0XW6ttyHGIqUqxoo8zFBEaDQlxa5oaW3iXSmcA+rrfolPO6gl9wI4PxH2kbxDeLoSo4Jolle3Oqv5SwcNOUChMHWsdJwrLDKvz995SvPJdVNkfsIAz1dDw8NYo0SroxIdC/3XzBQ==
430
+
431
+ ### Admin commands
432
+
433
+ Admin commands are used for server wide configuration, and are only available to server admins I.e. users who are members of the 'admins' group.
434
+
435
+ Admin commands are grouped under the following categories:
436
+
437
+ |Group|Description|
438
+ |---|---|
439
+ |organization|Manage organizations|
440
+ |user|Manage users|
441
+
442
+ ##### admin organization list
443
+
444
+ List all of the organizations on the server.
445
+
446
+ $ cyclid admin organization list
447
+ admins
448
+ example
449
+ initech
450
+
451
+ ##### admin organization show
452
+
453
+ Show the details of an organization, including the owner email address, the list of organization members and its public key.
454
+
455
+ $ cyclid admin organization show example
456
+ Name: example
457
+ Owner Email: bob@example.com
458
+ Public Key: -----BEGIN PUBLIC KEY-----
459
+ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8P8CMCfYLqMfAGq/pWyV
460
+ r92w8TMo3A5Irf1iZsFko42WGgIdOAnDuguODUFIzWmyrKm1WL0+V403j914gCRL
461
+ 8Zi+To3qbQtLaD4etiP/p3Z6qEHt77rn67kRxKjpcyiHkwOtQxMO5VCXlYCvEnDz
462
+ 0Rn2cq9VutrjrZcOjNCk7AkUtTZ3arkntYPaNBtPDpQz1x3dGdumSgVBUx1dcaqE
463
+ khLVc1SB1mqPNcIKoqIQF5oNGBdNWA6oBxk5CNj1GfpXayawixjgvq+tkJo3mDbu
464
+ F6UzJ4UGzbpC3EYqCkEByNOXv4J2aYaOjChFUiHn1XcSUVZHkrzFcb47Pif1wshi
465
+ lwIDAQAB
466
+ -----END PUBLIC KEY-----
467
+ Members:
468
+ bob
469
+ lucy
470
+ dave
471
+ leslie
472
+
473
+ ##### admin organization create
474
+
475
+ Create a new organization. You must supply the name of the new organization, and the organization owners email. You may also optionally add a user as the initial organization admin using the `--admin/-a` option.
476
+
477
+ |Option|Short option|Description|
478
+ |---|---|---|
479
+ |--admin|-a|Username of the initial organization admin|
480
+
481
+ # Create the 'example' organization with no initial admin
482
+ $ cyclid admin organization create example bob@example.com
483
+ # Create the 'initech' organization with the user 'lucy' as the initial admin
484
+ $ cyclid admin organization create initech lucy@example.com --admin lucy
485
+
486
+ ##### admin organization modify
487
+
488
+ Change an organizations owner email address or organization membership. You can pass the following options:
489
+
490
+ |Option|Short option|Description|
491
+ |---|---|---|
492
+ |--email|-e|Change the organization owner email address|
493
+ |--members|-m|Set a list of organization members|
494
+
495
+ **Note:** The `--members/-m` option will *overwrite* the complete list of members for an organization. Organization admins can use the `organization member` collection of commands to add & remove individual members in an organization.
496
+
497
+ # Change the owner email for the 'example' organization
498
+ $ cyclid admin organization modify example --email robert@example.com
499
+
500
+ ##### admin organization delete
501
+
502
+ Delete an organization. By default the `organization delete` command will ask you to confirm the deletion first; you can over-ride this with the `--force/-f` option to force deletion without confirmation.
503
+
504
+ **Note:** Deleting organizations is not currently supported by the API and this command will always fail.
505
+
506
+ |Option|Short option|Description|
507
+ |---|---|---|
508
+ |--force|-f|Do not ask for confirmation before deleting the organization|
509
+
510
+ # Delete the 'initech' organization
511
+ $ cyclid admin organization delete initech
512
+
513
+ ##### admin user list
514
+
515
+ List all of the users on the server.
516
+
517
+ $ cyclid admin user list
518
+ admin
519
+ bob
520
+ lucy
521
+ dave
522
+ leslie
523
+
524
+ ##### admin user show
525
+
526
+ Show the details of a user, including their email address and the list organizations they belong to.
527
+
528
+ $ cyclid admin user show bob
529
+ Username: bob
530
+ Email: bob@example.com
531
+ Organizations:
532
+ example
533
+
534
+ ##### admin user create
535
+
536
+ Create a new user. You must supply the username of the new user, and the users email address.
537
+
538
+ You may also optionally set the users HTTP Basic password with the `--password/-p` option, or set their HMAC secret with the `--secret/-s` option. You must at least set their password *or* their HMAC secret for the user to be able to log in to the server.
539
+
540
+ The users HMAC secret should ideally be a suitably long (at least 256 bit) and random string, which the user should keep secure in their Cyclid configuration file.
541
+
542
+ |Option|Short option|Description|
543
+ |---|---|---|
544
+ |--password|-p|The new users initial HTTP Basic password|
545
+ |--secret|-s|The new users HMAC signing secret|
546
+
547
+ # Create the user 'bob' with an initial HMAC secret
548
+ $ cyclid admin user create bob bob@example.com -s b072d8b51cec2755145c401b9249a60ebd89b4704eeebc5b6805ba682d7fac53
549
+
550
+ ##### admin user passwd
551
+
552
+ Change a users password. The user password is only used for HTTP Basic authentication.
553
+
554
+ # Change the password for the user 'bob'
555
+ $ cyclid admin user passwd bob
556
+ Password: <enter new password>
557
+ Confirm password: <re-enter new password>
558
+
559
+ ##### admin user modify
560
+
561
+ Change a users email address, HMAC secret and/or password. You can pass the following options:
562
+
563
+ |Option|Short option|Description|
564
+ |---|---|---|
565
+ |--email|-e|Change the users email address|
566
+ |--secret|-s|Change the users HMAC secret|
567
+ |--password|-p|Change the users email address|
568
+
569
+ Unlike the interactive `user passwd` command you can use `user modify` and pass the users new password on the command line.
570
+
571
+ Your HMAC secret should ideally be a suitably long (at least 256 bit) and random string, which the user should keep secure in their Cyclid configuration file. After changing a users HMAC secret they will need to update their configuration file with the new secret before they can run any other Cyclid commands.
572
+
573
+ # Change the email address for the user 'bob'
574
+ $ cyclid admin user modify bob --email robert@example.com
575
+ # Change the HMAC secret for the user 'lucy'
576
+ $ cyclid admin user modify lucy --secret b072d8b51cec2755145c401b9249a60ebd89b4704eeebc5b6805ba682d7fac53
577
+
578
+ ##### admin user delete
579
+
580
+ Delete a user. By default the `user delete` command will ask you to confirm the deletion first; you can over-ride this with the `--force/-f` option to force deletion without confirmation.
581
+
582
+ |Option|Short option|Description|
583
+ |---|---|---|
584
+ |--force|-f|Do not ask for confirmation before deleting the user|
585
+
586
+ # Delete the user 'bob' without asking for confirmation
587
+ $ cyclid admin user delete bob --force