clever-tools 3.0.1 → 3.1.0
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.
- package/README.md +33 -255
- package/bin/clever.js +59 -57
- package/package.json +8 -4
- package/src/command-options.js +42 -0
- package/src/commands/applications.js +8 -5
- package/src/commands/create.js +4 -2
- package/src/commands/deploy.js +27 -5
- package/src/models/addon.js +1 -1
- package/src/models/app_configuration.js +14 -1
- package/src/models/application.js +5 -2
- package/src/models/domain.js +1 -1
- package/src/models/git.js +1 -1
- package/src/models/isomorphic-http-with-agent.js +19 -0
- package/CHANGELOG.md +0 -607
- package/src/get-output-format-option.js +0 -23
package/README.md
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Clever Tools
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Command Line Interface for Clever Cloud.
|
|
3
|
+
Deploy on Clever Cloud and control you applications, add-ons, services from command line.
|
|
6
4
|
|
|
7
5
|
## Installation
|
|
8
6
|
|
|
9
|
-
The
|
|
10
|
-
|
|
11
|
-
### Via npm
|
|
12
|
-
|
|
13
|
-
If you already have node/npm on your system, you can run:
|
|
7
|
+
Clever Tools are availables from many channels. The simpler way to install them, if you already have Node.js on your system, is through `npm` package manager:
|
|
14
8
|
|
|
15
9
|
```sh
|
|
16
10
|
npm install -g clever-tools
|
|
@@ -21,196 +15,32 @@ If you want to install our latest beta release, you can run:
|
|
|
21
15
|
```sh
|
|
22
16
|
npm install -g clever-tools@beta
|
|
23
17
|
```
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
```sh
|
|
41
|
-
curl -fsSL https://clever-tools.clever-cloud.com/gpg/cc-nexus-deb.public.gpg.key | gpg --dearmor -o /usr/share/keyrings/cc-nexus-deb.gpg
|
|
42
|
-
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/cc-nexus-deb.gpg] https://nexus.clever-cloud.com/repository/deb stable main" | tee -a /etc/apt/sources.list
|
|
43
|
-
apt-get update
|
|
44
|
-
apt-get install clever-tools
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
NOTES:
|
|
48
|
-
|
|
49
|
-
* The `.deb` packages are hosted on Clever Cloud's public Nexus instance available at [https://nexus.clever-cloud.com](https://nexus.clever-cloud.com).
|
|
50
|
-
* Our PGP key is required to trust the repository.
|
|
51
|
-
* If you want access to the beta channel, you can use this in your `sources.list`:
|
|
52
|
-
|
|
53
|
-
```sh
|
|
54
|
-
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/cc-nexus-deb.gpg] https://nexus.clever-cloud.com/repository/deb-beta beta main" | tee -a /etc/apt/sources.list
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
#### CentOS/Fedora (.rpm)
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
##### Warning
|
|
62
|
-
|
|
63
|
-
We recently moved from Bintray to a self-hosted Nexus repository available at [https://nexus.clever-cloud.com](https://nexus.clever-cloud.com).
|
|
64
|
-
If you were using Bintray to install our `.rpm` packages, you will need to remove the old `/etc/yum.repos.d/bintray-clevercloud-rpm.repo` before going further.
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
If you are using a GNU/Linux distribution that uses `.rpm` packages like CentOS or Fedora, you can run:
|
|
69
|
-
|
|
70
|
-
```sh
|
|
71
|
-
curl -s https://clever-tools.clever-cloud.com/repos/cc-nexus-rpm.repo > /etc/yum.repos.d/cc-nexus-rpm.repo
|
|
72
|
-
yum update
|
|
73
|
-
yum install clever-tools
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
NOTES:
|
|
77
|
-
|
|
78
|
-
* The `.rpm` packages are hosted on Clever Cloud's public Nexus instance available at [https://nexus.clever-cloud.com](https://nexus.clever-cloud.com).
|
|
79
|
-
* If you want access to the beta channel, you will need to edit `/etc/yum.repos.d/cc-nexus-rpm.repo` and set `enabled=1` for the `[clever-tools-beta]`.
|
|
80
|
-
|
|
81
|
-
#### Arch Linux
|
|
82
|
-
|
|
83
|
-
If you are using Arch Linux, the packages can be installed from AUR with this repo: [clever-tools-bin](https://aur.archlinux.org/packages/clever-tools-bin/).
|
|
84
|
-
If you don't know how to use this, you can run:
|
|
85
|
-
|
|
86
|
-
```sh
|
|
87
|
-
git clone https://aur.archlinux.org/clever-tools-bin.git clever-tools
|
|
88
|
-
cd clever-tools
|
|
89
|
-
makepkg -si
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
NOTES:
|
|
93
|
-
|
|
94
|
-
* If you want access to the beta channel, you can use this repo [clever-tools-bin-beta](https://aur.archlinux.org/packages/clever-tools-bin-beta/).
|
|
95
|
-
|
|
96
|
-
#### Exherbo
|
|
97
|
-
|
|
98
|
-
If you are using Exherbo, you can run:
|
|
99
|
-
|
|
100
|
-
```sh
|
|
101
|
-
cave resolve repository/CleverCloud -zx1
|
|
102
|
-
cave resolve clever-tools-bin -zx
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
#### Other distributions (.tar.gz)
|
|
106
|
-
|
|
107
|
-
If you are using another GNU/Linux distribution, you can download a `.tar.gz` archive and extract the binary in your `PATH`:
|
|
108
|
-
|
|
109
|
-
```sh
|
|
110
|
-
curl -O https://clever-tools.clever-cloud.com/releases/latest/clever-tools-latest_linux.tar.gz
|
|
111
|
-
tar xvzf clever-tools-latest_linux.tar.gz
|
|
112
|
-
cp clever-tools-latest_linux/clever ~/.local/bin/
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
NOTES:
|
|
116
|
-
|
|
117
|
-
* The packages are available on Clever Cloud's Cellar bucket: [clever-tools-latest_linux.tar.gz](https://clever-tools.clever-cloud.com/releases/latest/clever-tools-latest_linux.tar.gz).
|
|
118
|
-
* You can also retrieve any release (including beta) on this Cellar bucket by replacing `latest` (path and filename) with the version number you need.
|
|
119
|
-
|
|
120
|
-
### On macOS
|
|
121
|
-
|
|
122
|
-
#### Using homebrew
|
|
123
|
-
|
|
124
|
-
If you are using macOS and you have [homebrew](https://brew.sh) installed, you can run:
|
|
125
|
-
|
|
126
|
-
```sh
|
|
127
|
-
brew install CleverCloud/homebrew-tap/clever-tools
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
NOTES:
|
|
131
|
-
|
|
132
|
-
* If you want access to the beta channel, you can use `CleverCloud/homebrew-tap-beta/clever-tools` instead.
|
|
133
|
-
|
|
134
|
-
#### Using the `.tar.gz` archive
|
|
135
|
-
|
|
136
|
-
If you are using macOS, but you don't have [homebrew](https://brew.sh) installed, you can download a `.tar.gz` archive and extract the binary in your `PATH`:
|
|
137
|
-
|
|
138
|
-
```sh
|
|
139
|
-
curl -O https://clever-tools.clever-cloud.com/releases/latest/clever-tools-latest_macos.tar.gz
|
|
140
|
-
tar xvzf clever-tools-latest_macos.tar.gz
|
|
141
|
-
cp clever-tools-latest_macos/clever ~/.local/bin/
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
NOTES:
|
|
145
|
-
|
|
146
|
-
* The packages are available on Clever Cloud's Cellar bucket: [clever-tools-latest_macos.tar.gz](https://clever-tools.clever-cloud.com/releases/latest/clever-tools-latest_macos.tar.gz).
|
|
147
|
-
* You can also retrieve any release (including beta) on this Cellar bucket by replacing `latest` (path and filename) with the version number you need.
|
|
148
|
-
|
|
149
|
-
### On Windows
|
|
150
|
-
|
|
151
|
-
#### Using chocolatey
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
##### Warning
|
|
156
|
-
|
|
157
|
-
We recently moved from Bintray to a self-hosted Nexus repository available at [https://nexus.clever-cloud.com](https://nexus.clever-cloud.com).
|
|
158
|
-
If you were using Bintray to install our `.nupkg` packages, you will need to remove the old source.
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
|
|
162
|
-
If you are using Windows and you have [chocolatey](https://chocolatey.org) installed, you can run:
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
choco sources add -n=clevercloud -s='https://nexus.clever-cloud.com/repository/nupkg/'
|
|
166
|
-
choco install clever-tools
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
NOTES:
|
|
170
|
-
|
|
171
|
-
* If you want access to the beta channel, you can use `choco sources add -n=clevercloud -s='https://nexus.clever-cloud.com/repository/nupkg-beta/'` instead.
|
|
172
|
-
|
|
173
|
-
#### Using the `.zip` archive
|
|
174
|
-
|
|
175
|
-
If you are using Windows, but you don't have [chocolatey](https://chocolatey.org) installed, you can download a `.zip` archive and extract the binary in your `PATH`.
|
|
176
|
-
|
|
177
|
-
NOTES:
|
|
178
|
-
|
|
179
|
-
* The packages are available on Clever Cloud's Cellar bucket: [clever-tools-latest_win.tar.gz](https://clever-tools.clever-cloud.com/releases/latest/clever-tools-latest_win.zip).
|
|
180
|
-
* You can also retrieve any release (including beta) on this Cellar bucket by replacing `latest` (path and filename) with the version number you need.
|
|
181
|
-
|
|
182
|
-
### Via Docker
|
|
183
|
-
|
|
184
|
-
If you are using docker, you can use the image provided [here](https://hub.docker.com/r/clevercloud/clever-tools/).
|
|
185
|
-
|
|
186
|
-
```sh
|
|
187
|
-
docker pull clevercloud/clever-tools
|
|
188
|
-
docker run --rm clever-tools <command>
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
#### Dockerfile
|
|
192
|
-
|
|
193
|
-
In your `Dockerfile` you can copy the clever-tools CLI from the image itself with a simple one liner:
|
|
194
|
-
|
|
195
|
-
```Dockerfile
|
|
196
|
-
COPY --from=clevercloud/clever-tools /bin/clever /usr/local/bin/clever
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
### Via Nix
|
|
200
|
-
|
|
201
|
-
If you are using Nix, you will find a Nix derivation on Fretlink's GitHub repository: https://github.com/fretlink/clever-tools-nix
|
|
18
|
+
We also distribute binaries and packages for multiple systems and tools:
|
|
19
|
+
|
|
20
|
+
* [GNU/Linux](docs/setup-systems.md#gnulinux)
|
|
21
|
+
* [Arch Linux (AUR)](docs/setup-systems.md#arch-linux-aur)
|
|
22
|
+
* [CentOS/Fedora (.rpm)](docs/setup-systems.md#centosfedora-rpm)
|
|
23
|
+
* [Debian/Ubuntu (.deb)](docs/setup-systems.md#debianubuntu-deb)
|
|
24
|
+
* [Exherbo](docs/setup-systems.md#exherbo)
|
|
25
|
+
* [Binary (.tar.gz)](docs/setup-systems.md#other-distributions-targz)
|
|
26
|
+
* [macOS](docs/setup-systems.md#macos)
|
|
27
|
+
* [Homebrew](docs/setup-systems.md#homebrew)
|
|
28
|
+
* [Binary (.tar.gz)](docs/setup-systems.md#binary-zip)
|
|
29
|
+
* [Windows](docs/setup-systems.md#windows)
|
|
30
|
+
* [Chocolatey](docs/setup-systems.md#chocolatey)
|
|
31
|
+
* [Binary (.zip)](docs/setup-systems.md#binary-zip)
|
|
32
|
+
* [Docker](docs/setup-systems.md#docker)
|
|
33
|
+
* [Nix](docs/setup-systems.md#nix-package-manager)
|
|
202
34
|
|
|
203
35
|
## Enabling autocompletion
|
|
204
36
|
|
|
205
|
-
The clever-tools CLI comes with a comprehensive auto-completion system.
|
|
206
|
-
Some installation methods like `.deb` packages, `.rpm` packages or brew will try to enable it automatically.
|
|
207
|
-
If it does not work, try this for bash:
|
|
37
|
+
The clever-tools CLI comes with a comprehensive auto-completion system. Some installation methods through package managers will try to enable it automatically. If not, use this for bash:
|
|
208
38
|
|
|
209
39
|
```bash
|
|
210
40
|
clever --bash-autocomplete-script $(which clever) | sudo tee /usr/share/bash-completion/completions/clever
|
|
211
41
|
```
|
|
212
42
|
|
|
213
|
-
or
|
|
43
|
+
or that for zsh:
|
|
214
44
|
|
|
215
45
|
```bash
|
|
216
46
|
clever --zsh-autocomplete-script $(which clever) | sudo tee /usr/share/zsh/site-functions
|
|
@@ -248,7 +78,8 @@ Where `type` is one of:
|
|
|
248
78
|
- `haskell`: for haskell applications
|
|
249
79
|
- `jar`: for applications deployed as standalone jar files
|
|
250
80
|
- `maven`: for applications launched with maven
|
|
251
|
-
- `
|
|
81
|
+
- `meteor`: for Meteor applications launched with Node.js
|
|
82
|
+
- `node`: for Node.js applications
|
|
252
83
|
- `php`: for PHP applications
|
|
253
84
|
- `play1`: for Play1 applications
|
|
254
85
|
- `play2`: for Play2 applications
|
|
@@ -261,11 +92,17 @@ Where `type` is one of:
|
|
|
261
92
|
|
|
262
93
|
Where region is one of:
|
|
263
94
|
|
|
264
|
-
- `par` (
|
|
265
|
-
- `
|
|
95
|
+
- `par` (Paris, [Clever Cloud](https://www.clever-cloud.com/infrastructure/))
|
|
96
|
+
- `rbx` (Roubaix, OVHcloud)
|
|
97
|
+
- `rbxhds` (Roubaix, HDS servers, OVHcloud)
|
|
98
|
+
- `scw` (Paris, [Scaleway DC5](https://www.clever-cloud.com/blog/press/2023/01/17/clever-cloud-and-scaleway-join-forces-to-unveil-a-sovereign-european-paas-offering/))
|
|
99
|
+
- `jed` (Jeddah, Oracle Cloud)
|
|
100
|
+
- `mtl` (Montreal, OVHcloud)
|
|
101
|
+
- `sgp` (Singapore, OVHcloud)
|
|
102
|
+
- `syd` (Sydney, OVHcloud)
|
|
103
|
+
- `wsw` (Warsaw, OVHcloud)
|
|
266
104
|
|
|
267
|
-
`--org` allows you to chose the organisation in which your app is
|
|
268
|
-
created.
|
|
105
|
+
`--org` allows you to chose the organisation in which your app is created.
|
|
269
106
|
|
|
270
107
|
`--alias` allows you to deploy the same application in multiple environments on Clever Cloud (eg: production, testing, …)
|
|
271
108
|
|
|
@@ -300,61 +137,6 @@ clever status [--alias <alias>]
|
|
|
300
137
|
clever scale [--alias <alias>] [--min-flavor <minflavor>] [--max-flavor <maxflavor>] [--min-instances <mininstances>] [--max-instances <maxinstances>]
|
|
301
138
|
```
|
|
302
139
|
|
|
303
|
-
### Logs Drains
|
|
304
|
-
|
|
305
|
-
```sh
|
|
306
|
-
# create drain
|
|
307
|
-
clever drain create [--alias <alias>] <DRAIN-TYPE> <DRAIN-URL> [--username <username>] [--password <password>]
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
```sh
|
|
311
|
-
# list drains
|
|
312
|
-
clever drain [--alias <alias>]
|
|
313
|
-
```
|
|
314
|
-
|
|
315
|
-
```sh
|
|
316
|
-
# remove drain
|
|
317
|
-
clever drain remove [--alias <alias>] <DRAIN-ID>
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
Where `DRAIN-TYPE` is one of:
|
|
321
|
-
|
|
322
|
-
- `TCPSyslog`: for TCP syslog endpoint;
|
|
323
|
-
- `UDPSyslog`: for UDP syslog endpoint;
|
|
324
|
-
- `HTTP`: for TCP syslog endpoint (note that this endpoint has optional username/passwordparameters as HTTP Basic Authentication);
|
|
325
|
-
- `ElasticSearch`: for ElasticSearch endpoint (note that this endpoint requires username/password parameters as HTTP Basic Authentication);
|
|
326
|
-
- `DatadogHTTP`: for Datadog endpoint (note that this endpoint needs your Datadog API Key).
|
|
327
|
-
- `NewRelicHTTP`: for NewRelic endpoint (note that this endpoint needs your NewRelic API Key).
|
|
328
|
-
|
|
329
|
-
#### ElasticSearch logs drains
|
|
330
|
-
|
|
331
|
-
ElasticSearch drains use the Elastic bulk API. To match this endpoint, specify `/_bulk` at the end of your ElasticSearch endpoint.
|
|
332
|
-
|
|
333
|
-
#### Datadog logs drains
|
|
334
|
-
|
|
335
|
-
Datadog has two zones, EU and COM. An account on one zone is not available on the other, make sure to target the good EU or COM intake endpoint.
|
|
336
|
-
|
|
337
|
-
To create a [Datadog](https://docs.datadoghq.com/api/?lang=python#send-logs-over-http) drain, you just need to use one of the following command depending on your zone:
|
|
338
|
-
|
|
339
|
-
```sh
|
|
340
|
-
# EU
|
|
341
|
-
clever drain create DatadogHTTP "https://http-intake.logs.datadoghq.eu/v1/input/<API_KEY>?ddsource=clevercloud&service=<SERVICE>&host=<HOST>"
|
|
342
|
-
# US
|
|
343
|
-
clever drain create DatadogHTTP "https://http-intake.logs.datadoghq.com/v1/input/<API_KEY>?ddsource=clevercloud&service=<SERVICE>&host=<HOST>"
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
Please note that the `host` query parameter is not mandatory: in the Datadog pipeline configuration, you can map `@source_host` which is the host provided by Clever Cloud in logs as `host` property.
|
|
347
|
-
|
|
348
|
-
#### NewRelic logs drains
|
|
349
|
-
|
|
350
|
-
NewRelic has two zones, EU and US. An account on one zone is not available on the other, make sure to target the good EU or US intake endpoint.
|
|
351
|
-
|
|
352
|
-
To create a [NewRelic](https://docs.newrelic.com/docs/logs/log-api/introduction-log-api/) drain, you just need to use:
|
|
353
|
-
|
|
354
|
-
```sh
|
|
355
|
-
clever drain create NewRelicHTTP "https://log-api.eu.newrelic.com/log/v1" --api-key <API_KEY>
|
|
356
|
-
```
|
|
357
|
-
|
|
358
140
|
### Display help
|
|
359
141
|
|
|
360
142
|
You can display help about each command with `clever help`.
|
|
@@ -377,10 +159,6 @@ clever deploy
|
|
|
377
159
|
|
|
378
160
|
[Send us an email!](mailto:support@clever-cloud.com) or [submit an issue](https://github.com/CleverCloud/clever-tools/issues).
|
|
379
161
|
|
|
380
|
-
## Automated testing
|
|
381
|
-
|
|
382
|
-
This project uses Travis CI to launch unit tests and validate pull requests before they're merged: https://travis-ci.org/CleverCloud/clever-tools
|
|
383
|
-
|
|
384
162
|
## Automated releases
|
|
385
163
|
|
|
386
164
|
This project uses Jenkins to build binaries, package them and release them automatically on the various repositories.
|