deployer/docs/recipe/deploy/update_code.md
Jan Henk Hazelaar 3953996a30
Add remote option to update_code_strategy to rename remote to repository (#3466)
* Add 'remote' option to 'update_code_strategy'

* Using archive and then add remote to speedup deployment

* Optimize remote option and add documentation

* Optimize code

* Update docs

* Combine clone and remote to remove duplicate code

* Removed  option and merge functionality into  option

* Generate docs

* Generate docs
2023-02-10 23:51:27 +01:00

91 lines
2.3 KiB
Markdown

<!-- DO NOT EDIT THIS FILE! -->
<!-- Instead edit recipe/deploy/update_code.php -->
<!-- Then run bin/docgen -->
# Update Code Recipe
```php
require 'recipe/deploy/update_code.php';
```
[Source](/recipe/deploy/update_code.php)
## Configuration
### branch
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/update_code.php#L11)
Determines which branch to deploy. Can be overridden with CLI option `--branch`.
If not specified, will get current git HEAD branch as default branch to deploy.
```php title="Default value"
'HEAD'
```
### target
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/update_code.php#L18)
The deploy target: a branch, a tag or a revision.
:::info Autogenerated
The value of this configuration is autogenerated on access.
:::
### update_code_strategy
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/update_code.php#L47)
Sets deploy:update_code strategy.
Can be one of:
- archive
- clone (if you need the origin repository `.git` dir in your [release_path](/docs/recipe/deploy/release.md#release_path))
```php title="Default value"
'archive'
```
### git_ssh_command
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/update_code.php#L53)
Sets environment variable _GIT_SSH_COMMAND_ for `git clone` command.
If `StrictHostKeyChecking` flag is set to `accept-new` then ssh will
automatically add new host keys to the user known hosts files, but
will not permit connections to hosts with changed host keys.
```php title="Default value"
'ssh -o StrictHostKeyChecking=accept-new'
```
### sub_directory
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/update_code.php#L65)
Specifies a sub directory within the repository to deploy.
Works only when [`update_code_strategy`](#update_code_strategy) is set to `archive` (default).
Example:
- set value to `src` if you want to deploy the folder that lives at `/src/api`.
- set value to `src/api` if you want to deploy the folder that lives at `/src/api`.
Note: do not use a leading `/`!
```php title="Default value"
false
```
## Tasks
### deploy:update_code
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/update_code.php#L71)
Updates code.
Update code at [release_path](/docs/recipe/deploy/release.md#release_path) on host.