Command Line Interface for Clever Cloud.
Please follow the installation instructions for your platform (see below) and make sure to uninstall the npm version with this:
npm uninstall -g clever-tools
Please refer to https://www.clever-cloud.com/doc/clever-tools/getting_started/ for the installation details.
Clever Tools is packaged using homebrew:
brew install CleverCloud/tap/clever-tools
If you don't want to use brew, a pre-compiled version is available: clever-tools-latest_macos.tar.gz.
You need to put both files (clever and nodegit.node) in your PATH to use the application.
Clever Tools comes with a comprehensive auto-completion system. The brew package installs it automatically (for bash and zsh). Make sure bash-completions or zsh-completions are properly set up.
# In ~/.bash_profile
. /usr/local/etc/bash_completion
# In ~/.zshrc
fpath=(/usr/local/share/zsh-completions $fpath)
Clever Tools is packaged using chocolatey:
choco install clever-tools
If you don't want to use chocolatey, a pre-compiled version is available: clever-tools-latest_win.zip.
You need to add both files (clever.exe and nodegit.node) to your PATH to use the application.
The package is available on the AUR: clever-tools-bin
A pre-compiled version is available: clever-tools-latest_linux.tar.gz.
You need to add both files (clever and nodegit.node) to your PATH
(you can put them in ~/.local/bin for instance)
to use the application.
curl -O https://clever-tools.cellar.services.clever-cloud.com/releases/latest/clever-tools-latest_linux.tar.gz
tar zxf clever-tools-latest_linux.tar.gz
cp {clever,nodegit.node} ~/.local/bin/
Clever Tools comes with a comprehensive auto-completion system.
# for bash
clever --bash-autocomplete-script $(which clever) | sudo tee /usr/share/bash-completion/completions/clever
# for zsh
clever --zsh-autocomplete-script $(which clever) | sudo tee /usr/share/zsh/site-functions
To use clever-tools, you have to login.
clever loginIt will open a page in your browser. Copy the provided token and secret
codes in the CLI.
clever login tries to open a browser through xdg-open on GNU/Linux systems
(and in bash for windows). Make sure you have xdg-utils available as well as
a default browser set (or you can copy and paste the URL displayed in the
console.
clever create <name> --type <type> \
[--region <region>] \
[--org <organisation>] \
[--alias <alias>]Where type is one of:
docker: for Docker-based applicationsgo: for Go applicationsgradle: for applications launched with gradlehaskell: for haskell applicationsjar: for applications deployed as standalone jar filesmaven: for applications launched with mavennode: for node.js applicationsphp: for PHP applicationsplay1: for Play1 applicationsplay2: for Play2 applicationspython: for python27 applicationsruby: for ruby applicationsrust: for rust applicationssbt: for applications launched with SBTstatic-apache: for static (HTML only) websiteswar: for applications deployed as war files
Where region is one of:
par(for Paris)mtl(for Montreal)
--org allows you to chose the organisation in which your app is
created.
--alias allows you to deploy the same application in multiple environments on Clever Cloud (eg: production, testing, …)
clever link [--org <ORG-NAME>] <APP-NAME> [--alias <alias>]Where APP-NAME is the name of your application, and ORG-NAME is the name
of the organisation it's in. You can specify a complete application id instead
of its name (in that case, --org can be omitted).
clever deploy [--alias <alias>]--alias allows you to deploy your application several times on Clever Cloud
(eg: production, testing, …)
clever status [--alias <alias>]clever scale [--alias <alias>] [--min-flavor <minflavor>] [--max-flavor <maxflavor>] [--min-instances <mininstances>] [--max-instances <maxinstances>]# create drain
clever drain create [--alias <alias>] <DRAIN-TYPE> <DRAIN-URL> [--username <username>] [--password <password>]# list drains
clever drain [--alias <alias>]# remove drain
clever drain remove [--alias <alias>] <DRAIN-ID>Where DRAIN-TYPE is one of:
TCPSyslog: for TCP syslog endpoint ;UDPSyslog: for UDP syslog endpoint ;HTTP: for TCP syslog endpoint (note that this endpoint has optional username/passwordparameters as HTTP Basic Authentication);ElasticSearch: for ElasticSearch endpoint (note that this endpoint requires username/password parameters as HTTP Basic Authentication).
ElasticSearch drains use the Elastic bulk API. To match this endpoint, specify /_bulk at the end of your ElasticSearch endpoint.
You can display help about each command with clever help.
clever help
clever help deploycd node_project
clever login
clever create "Node.js application" -t node -r mtl
clever deploySend us an email! or submit an issue.
This project uses Travis CI to launch unit tests and validate pull requests before they're merged: https://travis-ci.org/CleverCloud/clever-tools
When it comes to support multiple platforms (MacOS, Windows & GNU/Linux) and multiple versions of node.js, one of our dependencies (nodegit) is a tricky beast. In order to simplify the development and maintenance of this project, we chose to package the clever tools CLI with pkg. It allowed us to:
- fix node.js to a version that is officially tested with nodegit (8.3.0 for now)
- produce one binary per platform (MacOS, Windows & GNU/Linux) with one command
- the only caveat is that the binary is not 100% standalone because we need to provide
nodegit.nodealong with it
- the only caveat is that the binary is not 100% standalone because we need to provide
To distribute these binaries, we're packaging them as archives and releasing them on a Clever Cloud cellar bucket. We're also distributing them via platform specific systems (archlinux AUR, homebrew, chocolatey).
All those packages are built with an internal Jenkins. Here are some details about those build jobs.
Job: clever-tools
- This job runs
scripts/release-job.shon each commit merged to the master branch. - It builds 3 archives, one for each platform (MacOS, Windows & GNU/Linux) and computes sha256 sums.
- The files are always named with
master.
- The files are always named with
- All those artifacts (tar.gz, zip and sha256) are archived on Jenkins.
Job: clever-tools-tag
- This job runs
scripts/release-job.shon each tag. - It builds 3 archives, one for each platform (MacOS, Windows & GNU/Linux) and computes sha256 sums.
- The files are named with the tag name (semver
X.Y.Z). - The files are also copy/pasted with
latest.
- The files are named with the tag name (semver
- All those artifacts (tar.gz, zip and sha256) are published on a Clever Cloud cellar bucket.
This job also triggers 3 sub-jobs :
clever-tools-bin-archclever-tools-brewclever-tools-choco
All those jobs receive 2 variables: the tag name and the sha256 sums.
This job builds a new archlinux AUR package with the following tasks:
- clone this project clever-tools-bin
- use sed command on files
PKGBUILD.templateand.SRCINFO.templateto inject variables (version and sha256 sum) and create new files - create a new commit with ci@clever-cloud.com
- push to remote master (which will make the new aur package available)
Job: clever-tools-brew
This job builds a new homebrew package with the following tasks:
- clone this project homebrew-tap
- use sed command on file
clever-tools.template.rbto inject variables (version and sha256 sum) and create new file - create a new commit with ci@clever-cloud.com
- push to remote master (which will make the homebrew package available)
Job: clever-tools-choco
This job builds a new chocolatey package with the following tasks:
- clone this project chocolatey-packages
- run
scripts/build-nupkg.shto produce the new nupkg file- This nupkg file artifact is archived on Jenkins.