class Dpl::Provider

Base class for all concrete providers that ‘dpl` supports.

These are subclasses of ‘Cl::Cmd` which means they are going to be detected by the first argument passed to `dpl [provider]`, instantiated, and run.

Implementors are encouraged to use the provider DSL to declare various features, requirements, and attributes that apply to their provider, to implement any of the following stages (methods) according to their needs and semantics:

* init
* install
* login
* setup
* validate
* prepare
* deploy
* finish

The main logic should sit in the ‘deploy` stage.

If at any time the method ‘error` is called, or any exception raised the deploy process will be halted, and subsequent stages skipped. However, the stage `finish` will run even if previous stages have raised an error, giving the provider the opportunity to potentially clean up stage.

In addition to this the following methods will be called if implemented by the provider:

* run_cmd
* add_key
* remove_key

Like the ‘finish` stage, the method `remove_key` will be called even if previous stages have raised an error.

See the respective method’s documentation for details on these.

The following stages are not meant to be overwritten, but considered internal:

* before_install
* before_setup
* before_prepare
* before_finish

Dependencies declared as required, such as APT, NPM, or Python are going to be installed as part of the ‘before_install` stage .

Cleanup is run as part of the ‘before_prepare` stage if the option `–cleanup` was given. This will use `git stash –all` in order to reset the working directory to the committed state, and cleanup any left over artifacts from the build process. Providers can use the DSL method `keep` in order to declare known artifacts (such as CLI tooling installed to the working directory) that needs to be moved out of the way and restored after the cleanup process. (It is recommended to place such artifacts outside of the build working directory though, for example in `~/.dpl`).

The method ‘run_cmd` is called for each command specified using the `–run` option. By default, these command are going to be run as local shell commands, but providers can choose to overwrite this method in order to run the command on a remote machine.

@see github.com/svenfuchs/cl Cl’s documentation for details on how providers (commands) are declared and run.