devnomads-cli 0.12.1__tar.gz → 0.14.0__tar.gz
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.
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/PKG-INFO +108 -13
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/README.md +107 -12
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/devnomads_cli.egg-info/PKG-INFO +108 -13
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/devnomads_cli.egg-info/SOURCES.txt +3 -0
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/dncli.py +3277 -219
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/pyproject.toml +1 -1
- devnomads_cli-0.14.0/tests/test_agent_features.py +483 -0
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/tests/test_cli.py +8 -8
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/tests/test_config.py +1 -1
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/tests/test_generate.py +64 -4
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/tests/test_generated_cli.py +21 -11
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/tests/test_helpers.py +55 -3
- devnomads_cli-0.14.0/tests/test_sites_publish.py +384 -0
- devnomads_cli-0.14.0/tests/test_sites_ssh.py +124 -0
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/tests/test_transfer.py +1 -1
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/LICENSE +0 -0
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/devnomads_cli.egg-info/dependency_links.txt +0 -0
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/devnomads_cli.egg-info/entry_points.txt +0 -0
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/devnomads_cli.egg-info/requires.txt +0 -0
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/devnomads_cli.egg-info/top_level.txt +0 -0
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/setup.cfg +0 -0
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/tests/test_cert.py +0 -0
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/tests/test_hook.py +0 -0
- {devnomads_cli-0.12.1 → devnomads_cli-0.14.0}/tests/test_versions.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: devnomads-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.14.0
|
|
4
4
|
Summary: Manage your DevNomads services from the command line
|
|
5
5
|
Author-email: DevNomads <support@devnomads.nl>
|
|
6
6
|
License: MIT
|
|
@@ -98,8 +98,73 @@ Every DevNomads product has its own command group - `apps`,
|
|
|
98
98
|
your SSH keys and `jobs` for background work. Explore with
|
|
99
99
|
`dncli --help` and `dncli <group> --help`.
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
list`. An ambiguous prefix lists the candidates.
|
|
101
|
+
In a terminal, commands accept any unambiguous prefix: `dncli e l` is
|
|
102
|
+
`dncli emails list`. An ambiguous prefix lists the candidates. Scripts
|
|
103
|
+
(no terminal on stdin) must spell commands out, so a truncated name can
|
|
104
|
+
never run a different command; dncli then names the command you meant.
|
|
105
|
+
|
|
106
|
+
`dncli commands` lists every command with its options, and marks the
|
|
107
|
+
ones that change something, ask for confirmation, run in the
|
|
108
|
+
background or start billing. `dncli commands --out json sites` gives
|
|
109
|
+
the full detail for one group, for scripts and AI agents.
|
|
110
|
+
|
|
111
|
+
## Logging in to a site
|
|
112
|
+
|
|
113
|
+
`dncli sites ssh` opens an SSH session as the site's system user,
|
|
114
|
+
`site<service_id>`, so you don't need to know that name:
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
dncli sites ssh example.com
|
|
118
|
+
dncli sites ssh example.com -- ls -la # run one command
|
|
119
|
+
dncli sites ssh example.com --dry-run # print the ssh command
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The API doesn't say which host to SSH into, so the first time for a
|
|
123
|
+
site cluster dncli asks for it and remembers the answer per cluster in
|
|
124
|
+
`ssh-hosts` in its config directory. Pass `--host` to give or change
|
|
125
|
+
it without the question, for example in a script. Anything after `--`
|
|
126
|
+
goes to ssh: extra options (`-- -p 2222`) or a remote command.
|
|
127
|
+
|
|
128
|
+
ssh logs in with your SSH key when the site has it (`dncli sites keys
|
|
129
|
+
attach`); otherwise ssh itself asks for the site's password. dncli never
|
|
130
|
+
sees or stores that password. Scripts and other runs without a terminal
|
|
131
|
+
cannot answer a password prompt, so they need key login.
|
|
132
|
+
|
|
133
|
+
## Publishing a site
|
|
134
|
+
|
|
135
|
+
`dncli sites publish` uploads a folder (the current one by default) to
|
|
136
|
+
a site with rsync, over the same SSH login as `dncli sites ssh`:
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
dncli sites publish example.com ./dist --dry-run # show what would change
|
|
140
|
+
dncli sites publish example.com ./dist # new and changed files
|
|
141
|
+
dncli sites publish example.com ./dist --delete # also remove files not in ./dist
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Files go to `/home/site<service_id>/domains/<domain>/public_html`. `.git/`
|
|
145
|
+
is never uploaded; `--exclude` leaves out more (repeat it). You need
|
|
146
|
+
rsync locally and on the server.
|
|
147
|
+
|
|
148
|
+
**Release mode.** `--release` switches a site to versioned uploads:
|
|
149
|
+
each publish goes into `public_html/releases/<timestamp>/` (unchanged
|
|
150
|
+
files are hard links to the previous release, so only changes are
|
|
151
|
+
transferred) and the `public_html/current` symlink switches to it in
|
|
152
|
+
one step, so visitors never see a half-finished upload. dncli points
|
|
153
|
+
the site's document root into `current` through the API, e.g. `/public`
|
|
154
|
+
becomes `/current/public`. After that every publish makes a release;
|
|
155
|
+
`--keep` (default 5) sets how many stay.
|
|
156
|
+
|
|
157
|
+
```sh
|
|
158
|
+
dncli sites publish example.com ./dist --release # switch, asks first
|
|
159
|
+
dncli sites releases example.com # list releases
|
|
160
|
+
dncli sites rollback example.com # back to the previous one
|
|
161
|
+
dncli sites publish example.com ./dist --no-release # back to plain mode
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Every release starts from your folder alone: files the site writes
|
|
165
|
+
into its own folder (uploads, caches) are not carried over. Switching
|
|
166
|
+
mode changes the live site, so dncli asks first (`--yes` skips the
|
|
167
|
+
question); the old mode's files stay on the server, no longer served.
|
|
103
168
|
|
|
104
169
|
## Managing DNS
|
|
105
170
|
|
|
@@ -184,23 +249,53 @@ fields, and reports an error on an unknown column name.
|
|
|
184
249
|
|
|
185
250
|
Commands that take a service id also accept a unique entity name and
|
|
186
251
|
resolve it for you, so `dncli domains show example.com` works as well
|
|
187
|
-
as `dncli domains show 1234`.
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
numeric id
|
|
252
|
+
as `dncli domains show 1234`. Clients, SSH keys, clusters, hypervisors,
|
|
253
|
+
database users and volumes take a name too, as an argument or an
|
|
254
|
+
option: `dncli databases permissions create stelling_bg25 --user-id stelling`. The
|
|
255
|
+
help of each such option says which field it matches. Names match
|
|
256
|
+
regardless of case. A purely numeric value is always treated as an id;
|
|
257
|
+
a name that matches more than one entity is rejected, so pass the id
|
|
258
|
+
when a name is not unique.
|
|
259
|
+
|
|
260
|
+
Every command that changes something takes `--dry-run`: it resolves
|
|
261
|
+
names to ids and prints the request it would send, without sending it
|
|
262
|
+
(secrets masked).
|
|
263
|
+
|
|
264
|
+
Passwords stay off the command line with `--password -`, which reads
|
|
265
|
+
the password from stdin, or `--generate-password`, which creates a
|
|
266
|
+
strong one and prints it once on stderr.
|
|
267
|
+
|
|
268
|
+
List options on update commands (`--alias`, `--backend`) replace the
|
|
269
|
+
whole list; `--add-alias` and `--remove-alias` change one entry and
|
|
270
|
+
keep the rest.
|
|
192
271
|
|
|
193
272
|
Some changes run in the background: creating a site, server, proxy or
|
|
194
273
|
domain, for example, queues one or more jobs in a batch. Such a command
|
|
195
274
|
prints the queued jobs and returns right away; add `--wait` to follow
|
|
196
275
|
the batch until every job has finished and see how each one ended.
|
|
197
|
-
With `--wait` the exit status is 0 only when every job completed
|
|
276
|
+
With `--wait` the exit status is 0 only when every job completed (1
|
|
277
|
+
when a job failed, 7 when `--timeout` ran out). You
|
|
198
278
|
can look a batch up later with `dncli jobs batches show <batch_id>`.
|
|
199
279
|
|
|
200
|
-
The exit status is 0 when the API accepted the request
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
280
|
+
The exit status is 0 when the API accepted the request, so `dncli ...
|
|
281
|
+
&& next-step` is safe in scripts. A failure says what kind it is:
|
|
282
|
+
|
|
283
|
+
| Exit | Meaning |
|
|
284
|
+
|---|---|
|
|
285
|
+
| 1 | other errors, e.g. a background job failed |
|
|
286
|
+
| 2 | wrong command, option or value, or `--yes` needed |
|
|
287
|
+
| 3 | not found (404, or no entity with that name) |
|
|
288
|
+
| 4 | API key missing or rejected, or no permission |
|
|
289
|
+
| 5 | the API rejected the request (validation), or a name is ambiguous |
|
|
290
|
+
| 6 | rate limited, server error or network failure: retry later |
|
|
291
|
+
| 7 | `--wait` timed out; the jobs keep running |
|
|
292
|
+
|
|
293
|
+
When output is JSON and stderr is not a terminal, the error is one
|
|
294
|
+
JSON line on stderr, e.g. `{"error": {"message": "...", "kind":
|
|
295
|
+
"invalid", "exit": 5, "status": 422}}`; option parsing errors (exit 2)
|
|
296
|
+
stay plain text. Every command takes `--timeout
|
|
297
|
+
<seconds>` (default 300) for how long to wait for the API, including
|
|
298
|
+
the time spent waiting on `--wait`.
|
|
204
299
|
|
|
205
300
|
In CI and pipelines, skip the credentials file and pass the key via
|
|
206
301
|
the environment:
|
|
@@ -82,8 +82,73 @@ Every DevNomads product has its own command group - `apps`,
|
|
|
82
82
|
your SSH keys and `jobs` for background work. Explore with
|
|
83
83
|
`dncli --help` and `dncli <group> --help`.
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
list`. An ambiguous prefix lists the candidates.
|
|
85
|
+
In a terminal, commands accept any unambiguous prefix: `dncli e l` is
|
|
86
|
+
`dncli emails list`. An ambiguous prefix lists the candidates. Scripts
|
|
87
|
+
(no terminal on stdin) must spell commands out, so a truncated name can
|
|
88
|
+
never run a different command; dncli then names the command you meant.
|
|
89
|
+
|
|
90
|
+
`dncli commands` lists every command with its options, and marks the
|
|
91
|
+
ones that change something, ask for confirmation, run in the
|
|
92
|
+
background or start billing. `dncli commands --out json sites` gives
|
|
93
|
+
the full detail for one group, for scripts and AI agents.
|
|
94
|
+
|
|
95
|
+
## Logging in to a site
|
|
96
|
+
|
|
97
|
+
`dncli sites ssh` opens an SSH session as the site's system user,
|
|
98
|
+
`site<service_id>`, so you don't need to know that name:
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
dncli sites ssh example.com
|
|
102
|
+
dncli sites ssh example.com -- ls -la # run one command
|
|
103
|
+
dncli sites ssh example.com --dry-run # print the ssh command
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The API doesn't say which host to SSH into, so the first time for a
|
|
107
|
+
site cluster dncli asks for it and remembers the answer per cluster in
|
|
108
|
+
`ssh-hosts` in its config directory. Pass `--host` to give or change
|
|
109
|
+
it without the question, for example in a script. Anything after `--`
|
|
110
|
+
goes to ssh: extra options (`-- -p 2222`) or a remote command.
|
|
111
|
+
|
|
112
|
+
ssh logs in with your SSH key when the site has it (`dncli sites keys
|
|
113
|
+
attach`); otherwise ssh itself asks for the site's password. dncli never
|
|
114
|
+
sees or stores that password. Scripts and other runs without a terminal
|
|
115
|
+
cannot answer a password prompt, so they need key login.
|
|
116
|
+
|
|
117
|
+
## Publishing a site
|
|
118
|
+
|
|
119
|
+
`dncli sites publish` uploads a folder (the current one by default) to
|
|
120
|
+
a site with rsync, over the same SSH login as `dncli sites ssh`:
|
|
121
|
+
|
|
122
|
+
```sh
|
|
123
|
+
dncli sites publish example.com ./dist --dry-run # show what would change
|
|
124
|
+
dncli sites publish example.com ./dist # new and changed files
|
|
125
|
+
dncli sites publish example.com ./dist --delete # also remove files not in ./dist
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Files go to `/home/site<service_id>/domains/<domain>/public_html`. `.git/`
|
|
129
|
+
is never uploaded; `--exclude` leaves out more (repeat it). You need
|
|
130
|
+
rsync locally and on the server.
|
|
131
|
+
|
|
132
|
+
**Release mode.** `--release` switches a site to versioned uploads:
|
|
133
|
+
each publish goes into `public_html/releases/<timestamp>/` (unchanged
|
|
134
|
+
files are hard links to the previous release, so only changes are
|
|
135
|
+
transferred) and the `public_html/current` symlink switches to it in
|
|
136
|
+
one step, so visitors never see a half-finished upload. dncli points
|
|
137
|
+
the site's document root into `current` through the API, e.g. `/public`
|
|
138
|
+
becomes `/current/public`. After that every publish makes a release;
|
|
139
|
+
`--keep` (default 5) sets how many stay.
|
|
140
|
+
|
|
141
|
+
```sh
|
|
142
|
+
dncli sites publish example.com ./dist --release # switch, asks first
|
|
143
|
+
dncli sites releases example.com # list releases
|
|
144
|
+
dncli sites rollback example.com # back to the previous one
|
|
145
|
+
dncli sites publish example.com ./dist --no-release # back to plain mode
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Every release starts from your folder alone: files the site writes
|
|
149
|
+
into its own folder (uploads, caches) are not carried over. Switching
|
|
150
|
+
mode changes the live site, so dncli asks first (`--yes` skips the
|
|
151
|
+
question); the old mode's files stay on the server, no longer served.
|
|
87
152
|
|
|
88
153
|
## Managing DNS
|
|
89
154
|
|
|
@@ -168,23 +233,53 @@ fields, and reports an error on an unknown column name.
|
|
|
168
233
|
|
|
169
234
|
Commands that take a service id also accept a unique entity name and
|
|
170
235
|
resolve it for you, so `dncli domains show example.com` works as well
|
|
171
|
-
as `dncli domains show 1234`.
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
numeric id
|
|
236
|
+
as `dncli domains show 1234`. Clients, SSH keys, clusters, hypervisors,
|
|
237
|
+
database users and volumes take a name too, as an argument or an
|
|
238
|
+
option: `dncli databases permissions create stelling_bg25 --user-id stelling`. The
|
|
239
|
+
help of each such option says which field it matches. Names match
|
|
240
|
+
regardless of case. A purely numeric value is always treated as an id;
|
|
241
|
+
a name that matches more than one entity is rejected, so pass the id
|
|
242
|
+
when a name is not unique.
|
|
243
|
+
|
|
244
|
+
Every command that changes something takes `--dry-run`: it resolves
|
|
245
|
+
names to ids and prints the request it would send, without sending it
|
|
246
|
+
(secrets masked).
|
|
247
|
+
|
|
248
|
+
Passwords stay off the command line with `--password -`, which reads
|
|
249
|
+
the password from stdin, or `--generate-password`, which creates a
|
|
250
|
+
strong one and prints it once on stderr.
|
|
251
|
+
|
|
252
|
+
List options on update commands (`--alias`, `--backend`) replace the
|
|
253
|
+
whole list; `--add-alias` and `--remove-alias` change one entry and
|
|
254
|
+
keep the rest.
|
|
176
255
|
|
|
177
256
|
Some changes run in the background: creating a site, server, proxy or
|
|
178
257
|
domain, for example, queues one or more jobs in a batch. Such a command
|
|
179
258
|
prints the queued jobs and returns right away; add `--wait` to follow
|
|
180
259
|
the batch until every job has finished and see how each one ended.
|
|
181
|
-
With `--wait` the exit status is 0 only when every job completed
|
|
260
|
+
With `--wait` the exit status is 0 only when every job completed (1
|
|
261
|
+
when a job failed, 7 when `--timeout` ran out). You
|
|
182
262
|
can look a batch up later with `dncli jobs batches show <batch_id>`.
|
|
183
263
|
|
|
184
|
-
The exit status is 0 when the API accepted the request
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
264
|
+
The exit status is 0 when the API accepted the request, so `dncli ...
|
|
265
|
+
&& next-step` is safe in scripts. A failure says what kind it is:
|
|
266
|
+
|
|
267
|
+
| Exit | Meaning |
|
|
268
|
+
|---|---|
|
|
269
|
+
| 1 | other errors, e.g. a background job failed |
|
|
270
|
+
| 2 | wrong command, option or value, or `--yes` needed |
|
|
271
|
+
| 3 | not found (404, or no entity with that name) |
|
|
272
|
+
| 4 | API key missing or rejected, or no permission |
|
|
273
|
+
| 5 | the API rejected the request (validation), or a name is ambiguous |
|
|
274
|
+
| 6 | rate limited, server error or network failure: retry later |
|
|
275
|
+
| 7 | `--wait` timed out; the jobs keep running |
|
|
276
|
+
|
|
277
|
+
When output is JSON and stderr is not a terminal, the error is one
|
|
278
|
+
JSON line on stderr, e.g. `{"error": {"message": "...", "kind":
|
|
279
|
+
"invalid", "exit": 5, "status": 422}}`; option parsing errors (exit 2)
|
|
280
|
+
stay plain text. Every command takes `--timeout
|
|
281
|
+
<seconds>` (default 300) for how long to wait for the API, including
|
|
282
|
+
the time spent waiting on `--wait`.
|
|
188
283
|
|
|
189
284
|
In CI and pipelines, skip the credentials file and pass the key via
|
|
190
285
|
the environment:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: devnomads-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.14.0
|
|
4
4
|
Summary: Manage your DevNomads services from the command line
|
|
5
5
|
Author-email: DevNomads <support@devnomads.nl>
|
|
6
6
|
License: MIT
|
|
@@ -98,8 +98,73 @@ Every DevNomads product has its own command group - `apps`,
|
|
|
98
98
|
your SSH keys and `jobs` for background work. Explore with
|
|
99
99
|
`dncli --help` and `dncli <group> --help`.
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
list`. An ambiguous prefix lists the candidates.
|
|
101
|
+
In a terminal, commands accept any unambiguous prefix: `dncli e l` is
|
|
102
|
+
`dncli emails list`. An ambiguous prefix lists the candidates. Scripts
|
|
103
|
+
(no terminal on stdin) must spell commands out, so a truncated name can
|
|
104
|
+
never run a different command; dncli then names the command you meant.
|
|
105
|
+
|
|
106
|
+
`dncli commands` lists every command with its options, and marks the
|
|
107
|
+
ones that change something, ask for confirmation, run in the
|
|
108
|
+
background or start billing. `dncli commands --out json sites` gives
|
|
109
|
+
the full detail for one group, for scripts and AI agents.
|
|
110
|
+
|
|
111
|
+
## Logging in to a site
|
|
112
|
+
|
|
113
|
+
`dncli sites ssh` opens an SSH session as the site's system user,
|
|
114
|
+
`site<service_id>`, so you don't need to know that name:
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
dncli sites ssh example.com
|
|
118
|
+
dncli sites ssh example.com -- ls -la # run one command
|
|
119
|
+
dncli sites ssh example.com --dry-run # print the ssh command
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The API doesn't say which host to SSH into, so the first time for a
|
|
123
|
+
site cluster dncli asks for it and remembers the answer per cluster in
|
|
124
|
+
`ssh-hosts` in its config directory. Pass `--host` to give or change
|
|
125
|
+
it without the question, for example in a script. Anything after `--`
|
|
126
|
+
goes to ssh: extra options (`-- -p 2222`) or a remote command.
|
|
127
|
+
|
|
128
|
+
ssh logs in with your SSH key when the site has it (`dncli sites keys
|
|
129
|
+
attach`); otherwise ssh itself asks for the site's password. dncli never
|
|
130
|
+
sees or stores that password. Scripts and other runs without a terminal
|
|
131
|
+
cannot answer a password prompt, so they need key login.
|
|
132
|
+
|
|
133
|
+
## Publishing a site
|
|
134
|
+
|
|
135
|
+
`dncli sites publish` uploads a folder (the current one by default) to
|
|
136
|
+
a site with rsync, over the same SSH login as `dncli sites ssh`:
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
dncli sites publish example.com ./dist --dry-run # show what would change
|
|
140
|
+
dncli sites publish example.com ./dist # new and changed files
|
|
141
|
+
dncli sites publish example.com ./dist --delete # also remove files not in ./dist
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Files go to `/home/site<service_id>/domains/<domain>/public_html`. `.git/`
|
|
145
|
+
is never uploaded; `--exclude` leaves out more (repeat it). You need
|
|
146
|
+
rsync locally and on the server.
|
|
147
|
+
|
|
148
|
+
**Release mode.** `--release` switches a site to versioned uploads:
|
|
149
|
+
each publish goes into `public_html/releases/<timestamp>/` (unchanged
|
|
150
|
+
files are hard links to the previous release, so only changes are
|
|
151
|
+
transferred) and the `public_html/current` symlink switches to it in
|
|
152
|
+
one step, so visitors never see a half-finished upload. dncli points
|
|
153
|
+
the site's document root into `current` through the API, e.g. `/public`
|
|
154
|
+
becomes `/current/public`. After that every publish makes a release;
|
|
155
|
+
`--keep` (default 5) sets how many stay.
|
|
156
|
+
|
|
157
|
+
```sh
|
|
158
|
+
dncli sites publish example.com ./dist --release # switch, asks first
|
|
159
|
+
dncli sites releases example.com # list releases
|
|
160
|
+
dncli sites rollback example.com # back to the previous one
|
|
161
|
+
dncli sites publish example.com ./dist --no-release # back to plain mode
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Every release starts from your folder alone: files the site writes
|
|
165
|
+
into its own folder (uploads, caches) are not carried over. Switching
|
|
166
|
+
mode changes the live site, so dncli asks first (`--yes` skips the
|
|
167
|
+
question); the old mode's files stay on the server, no longer served.
|
|
103
168
|
|
|
104
169
|
## Managing DNS
|
|
105
170
|
|
|
@@ -184,23 +249,53 @@ fields, and reports an error on an unknown column name.
|
|
|
184
249
|
|
|
185
250
|
Commands that take a service id also accept a unique entity name and
|
|
186
251
|
resolve it for you, so `dncli domains show example.com` works as well
|
|
187
|
-
as `dncli domains show 1234`.
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
numeric id
|
|
252
|
+
as `dncli domains show 1234`. Clients, SSH keys, clusters, hypervisors,
|
|
253
|
+
database users and volumes take a name too, as an argument or an
|
|
254
|
+
option: `dncli databases permissions create stelling_bg25 --user-id stelling`. The
|
|
255
|
+
help of each such option says which field it matches. Names match
|
|
256
|
+
regardless of case. A purely numeric value is always treated as an id;
|
|
257
|
+
a name that matches more than one entity is rejected, so pass the id
|
|
258
|
+
when a name is not unique.
|
|
259
|
+
|
|
260
|
+
Every command that changes something takes `--dry-run`: it resolves
|
|
261
|
+
names to ids and prints the request it would send, without sending it
|
|
262
|
+
(secrets masked).
|
|
263
|
+
|
|
264
|
+
Passwords stay off the command line with `--password -`, which reads
|
|
265
|
+
the password from stdin, or `--generate-password`, which creates a
|
|
266
|
+
strong one and prints it once on stderr.
|
|
267
|
+
|
|
268
|
+
List options on update commands (`--alias`, `--backend`) replace the
|
|
269
|
+
whole list; `--add-alias` and `--remove-alias` change one entry and
|
|
270
|
+
keep the rest.
|
|
192
271
|
|
|
193
272
|
Some changes run in the background: creating a site, server, proxy or
|
|
194
273
|
domain, for example, queues one or more jobs in a batch. Such a command
|
|
195
274
|
prints the queued jobs and returns right away; add `--wait` to follow
|
|
196
275
|
the batch until every job has finished and see how each one ended.
|
|
197
|
-
With `--wait` the exit status is 0 only when every job completed
|
|
276
|
+
With `--wait` the exit status is 0 only when every job completed (1
|
|
277
|
+
when a job failed, 7 when `--timeout` ran out). You
|
|
198
278
|
can look a batch up later with `dncli jobs batches show <batch_id>`.
|
|
199
279
|
|
|
200
|
-
The exit status is 0 when the API accepted the request
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
280
|
+
The exit status is 0 when the API accepted the request, so `dncli ...
|
|
281
|
+
&& next-step` is safe in scripts. A failure says what kind it is:
|
|
282
|
+
|
|
283
|
+
| Exit | Meaning |
|
|
284
|
+
|---|---|
|
|
285
|
+
| 1 | other errors, e.g. a background job failed |
|
|
286
|
+
| 2 | wrong command, option or value, or `--yes` needed |
|
|
287
|
+
| 3 | not found (404, or no entity with that name) |
|
|
288
|
+
| 4 | API key missing or rejected, or no permission |
|
|
289
|
+
| 5 | the API rejected the request (validation), or a name is ambiguous |
|
|
290
|
+
| 6 | rate limited, server error or network failure: retry later |
|
|
291
|
+
| 7 | `--wait` timed out; the jobs keep running |
|
|
292
|
+
|
|
293
|
+
When output is JSON and stderr is not a terminal, the error is one
|
|
294
|
+
JSON line on stderr, e.g. `{"error": {"message": "...", "kind":
|
|
295
|
+
"invalid", "exit": 5, "status": 422}}`; option parsing errors (exit 2)
|
|
296
|
+
stay plain text. Every command takes `--timeout
|
|
297
|
+
<seconds>` (default 300) for how long to wait for the API, including
|
|
298
|
+
the time spent waiting on `--wait`.
|
|
204
299
|
|
|
205
300
|
In CI and pipelines, skip the credentials file and pass the key via
|
|
206
301
|
the environment:
|
|
@@ -8,6 +8,7 @@ devnomads_cli.egg-info/dependency_links.txt
|
|
|
8
8
|
devnomads_cli.egg-info/entry_points.txt
|
|
9
9
|
devnomads_cli.egg-info/requires.txt
|
|
10
10
|
devnomads_cli.egg-info/top_level.txt
|
|
11
|
+
tests/test_agent_features.py
|
|
11
12
|
tests/test_cert.py
|
|
12
13
|
tests/test_cli.py
|
|
13
14
|
tests/test_config.py
|
|
@@ -15,5 +16,7 @@ tests/test_generate.py
|
|
|
15
16
|
tests/test_generated_cli.py
|
|
16
17
|
tests/test_helpers.py
|
|
17
18
|
tests/test_hook.py
|
|
19
|
+
tests/test_sites_publish.py
|
|
20
|
+
tests/test_sites_ssh.py
|
|
18
21
|
tests/test_transfer.py
|
|
19
22
|
tests/test_versions.py
|