Skip to content

Commit 1e78e77

Browse files
committed
Update docs
1 parent 9b66699 commit 1e78e77

File tree

1 file changed

+89
-21
lines changed

1 file changed

+89
-21
lines changed

docs/installation.md

Lines changed: 89 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,125 @@
11
# Installation
22

3-
## Global installation
3+
There are two ways to install Deployer: globally or locally. Global installation is recommended for most users, as it
4+
allows you to use Deployer from any directory.
5+
Local (or project) installation is preferred for CI/CD pipelines, as it allows you to use the same version of Deployer
6+
across all environments.
47

5-
To install Deployer, run next command in your project dir:
8+
## Global Installation
69

7-
```
10+
To install Deployer globally, use one of the following commands in your project directory:
11+
12+
```sh
813
composer global require deployer/deployer
914
```
1015

11-
```
16+
Or:
17+
18+
```sh
1219
phive install deployer
1320
```
1421

15-
Run in your project to create `deploy.php` file:
22+
:::tip Path to Executable
23+
24+
Make sure that Composer's global bin directory is in your `PATH`. Typically, you can add the following line to your
25+
shell configuration file (e.g., `.bashrc`, `.zshrc`):
26+
27+
```sh
28+
export PATH="$HOME/.composer/vendor/bin:$PATH"
1629

17-
```
18-
dep init
1930
```
2031

21-
:::tip Autocomplete
32+
After adding this line, reload your shell configuration:
2233

23-
Deployer comes with autocomplete support for task names, options, and hosts.
34+
```sh
35+
source ~/.bashrc
36+
```
2437

25-
Run the next command to add bash completion support:
38+
or, for Zsh:
2639

40+
```sh
41+
source ~/.zshrc
2742
```
28-
dep completion bash > /etc/bash_completion.d/deployer
43+
44+
:::
45+
46+
To set up Deployer in your project and create the `deploy.php` configuration file, run:
47+
48+
```sh
49+
dep init
2950
```
3051

31-
Make sure what your _.bashrc_ file includes generated file in some way.
52+
### Autocomplete Support
3253

33-
:::
54+
Deployer includes support for autocompletion, helping you quickly find task names, options, and hosts. To enable
55+
autocomplete for various shells, use the following commands:
3456

35-
## Project installation
3657

37-
To install Deployer in your project, run next command in your project dir:
58+
- **Bash**:
3859

39-
```
60+
```sh
61+
dep completion bash > /etc/bash_completion.d/deployer
62+
```
63+
64+
Make sure your `.bashrc` file sources the generated file so that bash completion works.
65+
66+
- **Zsh**:
67+
68+
```sh
69+
dep completion zsh > ~/.zsh/completion/_deployer
70+
```
71+
72+
Ensure that your `.zshrc` file includes the directory where `_deployer` is located in the `fpath`.
73+
74+
- **Fish**:
75+
76+
```sh
77+
dep completion fish > ~/.config/fish/completions/deployer.fish
78+
```
79+
80+
The generated file will be automatically loaded by Fish.
81+
82+
## Project Installation
83+
84+
The project installation method is recommended for CI/CD pipelines, as it allows you to use the same version of Deployer
85+
across all environments.
86+
87+
To install Deployer in your project, run the following command:
88+
89+
```sh
4090
composer require --dev deployer/deployer
4191
```
4292

43-
To initialize deployer in your project run:
93+
:::tip Configuring Shell Alias
94+
To make using Deployer more convenient, you can set up a shell alias. This will allow you to run Deployer commands more
95+
easily. Add the following line to your shell configuration file (e.g., `.bashrc`, `.zshrc`):
4496

97+
```sh
98+
alias dep='vendor/bin/dep'
4599
```
100+
101+
This alias lets you use `dep` instead of typing the full path each time.
102+
:::
103+
104+
Then, to initialize Deployer in your project, use:
105+
106+
```sh
46107
vendor/bin/dep init
47108
```
48109

49-
## Phar download
110+
## Downloading the Phar File
50111

51-
You can download deployer phar file from [releases](https://github.com/deployphp/deployer/releases) page.
112+
Another option for installing Deployer is to download the Phar file. You can find the latest version on
113+
the [download page](/download).
52114

53-
After downloading, you can run it in your project dir:
115+
Adding `deployer.phar` to your project repository is recommended to ensure everyone, including your CI pipeline, uses
116+
the same version of Deployer. This helps maintain consistency across all environments.
54117

55-
```
118+
Once downloaded, run it in your project directory:
119+
120+
```sh
56121
php deployer.phar init
57122
```
123+
124+
This method provides a simple way to use Deployer without needing Composer.
125+

0 commit comments

Comments
 (0)