|
2 | 2 |
|
3 | 3 | ## Env
|
4 | 4 |
|
5 |
| -Field |Type |Tag |Description |
6 |
| ---- |---- |--- |--- |
7 |
| -`name` |*string* | |This parameter is the runtime environment such as `production`, `staging`, and `qa`. |
8 |
| -`task` |*string* |`github` |This parameter is used by the deployment system to distinguish the kind of deployment. The default values is `deploy`, but for rollback, the value is always `rollback`. |
9 |
| -`description` |*string* |`github` |This parameter is the short description of the deployment. The default value is `Gitploy starts to deploy.` |
10 |
| -`auto_merge` |*boolean* |`github` |This parameter is used to ensure that the requested ref is not behind the repository's default branch. If you deploy with the commit or the tag you need to set `false`. The default values is `true`, but for rollback, the value is always `false`. |
11 |
| -`required_contexts` |*[]string* |`github` |This parameter allows you to specify a subset of contexts that must be success. The default value is `nil`, it means every submitted context must be in a success state. |
12 |
| -`production_environment` |*boolean* |`github` |This parameter specifies whether this runtime environment is production or not. |
13 |
| -`approval` |*[Approval](#approval)* | |This parameter configures approval. |
| 5 | + |
| 6 | +Field |Type |Required |Description |
| 7 | +--- |---- |--- |--- |
| 8 | +`name` |*string* |`true` |This field is the runtime environment such as `production`, `staging`, and `qa`. |
| 9 | +`task` |*string* |`false` |This field is used by the deployment system to distinguish the kind of deployment. |
| 10 | +`description` |*string* |`false` |This field is the short description of the deployment. |
| 11 | +`auto_merge` |*boolean* |`false` |This field is used to ensure that the requested ref is not behind the repository's default branch. If you deploy with the commit or the tag you need to set `false`. For rollback, Gitploy set the field `false`. |
| 12 | +`required_contexts` |*[]string* |`false` |This field allows you to specify a subset of contexts that must be success. |
| 13 | +`production_environment` |*boolean* |`false` |This field specifies whether this runtime environment is production or not. |
| 14 | +`approval` |*[Approval](#approval)* |`false` |This field configures approval. |
14 | 15 |
|
15 | 16 | ## Approval
|
16 | 17 |
|
17 |
| -Field |Type |Tag |Description |
18 |
| ---- |--- |--- |--- |
19 |
| -`enabled` |*boolean* | |This parameter make to enable the approval feature. The default value is `false`. |
20 |
| -`required_count` |*integer* | |This parameter determine how many the required approving approvals is needs to deploy. The default value is `0`. |
| 18 | +Field |Type |Tag |Description |
| 19 | +--- |--- |--- |--- |
| 20 | +`enabled` |*boolean* |`true` |This field make to enable the approval feature. The default value is `false`. |
| 21 | +`required_count` |*integer* |`false` |This field determine how many the required approving approvals is needs to deploy. The default value is `0`. |
| 22 | + |
| 23 | +## Variables |
| 24 | + |
| 25 | +The following variables are available in `${ }` syntax when evaluating `deploy.yml` before deploy or rollback: |
| 26 | + |
| 27 | +* `GITPLOY_DEPLOY_TASK`: Returns `deploy` for deploy, but rollback, it returns the empty string. |
| 28 | +* `GITPLOY_ROLLBACK_TASK`: Returns `rollback` for rollback, but deploy, it returns the empty string. |
| 29 | +* `GITPLOY_IS_ROLLBACK`: Returns `true` for rollback, but deploy, it returns `false`. |
| 30 | + |
| 31 | +An example usage of this: |
| 32 | + |
| 33 | +```yaml |
| 34 | +envs: |
| 35 | + - name: prod |
| 36 | + task: "${GITPLOY_DEPLOY_TASK}${GITPLOY_ROLLBACK_TASK}:kubernetes" # It returns "deploy:kubernetes" or "rollback:kubernetes" |
| 37 | +``` |
21 | 38 |
|
22 |
| -## Tags |
| 39 | +And Gitploy provides the string operation to facilitate customized values. You can check supported functions at [here](https://github.com/drone/envsubst). |
23 | 40 |
|
24 |
| -* `github`: Github specific field. |
| 41 | +```yaml |
| 42 | +envs: |
| 43 | + - name: prod |
| 44 | + task: "${GITPLOY_DEPLOY_TASK=rollback}:kubernetes" # It returns "deploy:kubernetes" or "rollback:kubernetes" |
| 45 | +``` |
0 commit comments