Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit 9993e30

Browse files
author
Noah Hanjun Lee
authored
Add the documentation for usecase (#241)
1 parent dc44049 commit 9993e30

File tree

4 files changed

+56
-51
lines changed

4 files changed

+56
-51
lines changed

docs/concepts/deploy.yml.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
# deploy.yml
22

3-
Gitploy configures a pipeline with a simple, easy‑to‑read file that you commit to your git repository. *The configuration file must be at the head of the default branch.* The default path is `deploy.yml` at the root directory, but you can replace the file path in the settings tab of Gitploy. You can check the [document](../references/deploy.yml.md) for the specification of the configuration file.
3+
Gitploy configures a pipeline with a simple, easy‑to‑read file that you commit to your git repository. *The configuration file must be at the head of the default branch.* The default path is `deploy.yml` at the root directory, but you can replace the file path in the settings tab of Gitploy. You can check the [documentation](../references/deploy.yml.md) for the specification of the configuration file and also references [Use Cases](../tasks/usecases.md).
44

5-
## Environments
5+
## Features
6+
### Multi Environment
67

7-
You can configure each environments, respectively. The configuration have to be under the `evns` field. The following example show each environments have different configuration.
8+
For multi-environment, Gitploy provides you can make different pipelines for each environment, respectively. The configuration has to be defined under the `envs` field. The following example shows each environment has a different configuration.
89

910
```yaml
1011
envs:
11-
- name: dev
12+
# Development environment
13+
- name: development
1214
auto_merge: false
1315
required_contexts: []
16+
17+
# Production environment
1418
- name: production
1519
auto_merge: true
1620
required_contexts:
1721
- test
1822
- docker-image
1923
```
2024
21-
## Parameters of GitHub deployment API
25+
### Parameters of GitHub deployment API
2226
23-
Internally, Gitploy posts a deployment to GitHub [deployments API](https://docs.github.com/en/rest/reference/repos#create-a-deployment) with parameters from the configuration file. These parameter help you can verify the artifact before you start to deploy. The configuration file provides fields to configure all parameters of GitHub deployment API. You can check the [document](../references/deploy.yml.md) for the detail.
27+
Internally, Gitploy posts a deployment to GitHub [deployments API](https://docs.github.com/en/rest/reference/repos#create-a-deployment) with parameters from the configuration file. These parameters help you can verify the artifact before you start to deploy. The configuration provides fields to set all parameters of GitHub deployment API. You can check the [document](../references/deploy.yml.md) for the detail.
2428
2529
```yaml
2630
envs:
@@ -33,7 +37,7 @@ envs:
3337
- integration-test
3438
production_environment: true
3539
```
36-
## Review
40+
### Review
3741
3842
Gitploy provides the review process. You can list up to users on the configuration file. You can check the [document](./review.md) for the detail.
3943

docs/tasks/first-deployment.md

Lines changed: 0 additions & 43 deletions
This file was deleted.

docs/tasks/usecases.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Use Cases
2+
3+
## Deploying the head of the `main` branch
4+
5+
The general way of deployment is deploying the head of the `main` branch that has only verified commits. To constrain deploying only the head of the `main` branch, we can use the `auto_merge` parameter of GitHub [deployment API](https://docs.github.com/en/rest/reference/repos#create-a-deployment) to ensure that the deployment is the head of the branch, and set `deployable_ref` field with the `main`.
6+
7+
```yaml
8+
envs:
9+
- name: production
10+
auto_merge: true
11+
deployable_ref: main
12+
production_environment: true
13+
```
14+
15+
## Deploying with the version
16+
17+
The versioning is the general way to specify the artifact or the commit, and GitHub provides the release page for versioning. If your team (or organization) wants to constrain deploying with the version, you can use the `deployable_ref` field like below.
18+
19+
```yaml
20+
envs:
21+
- name: production
22+
auto_merge: false
23+
deployable_ref: "v.*\..*\..*" # Semantic versioning
24+
production_environment: true
25+
```
26+
27+
## Deploying the artifact
28+
29+
The artifact could be a binary file from compiling source codes or a docker image, which means we have to build the artifact before we deploy. The commit status is the best way to verify if the artifact exists or not. The builder, such as GitHub Action or Circle CI, posts the commit status after building the artifact, and we can verify it by the `required_contexts` parameter when we deploy. You can reference the `deploy.yml` of Gitploy.
30+
31+
```yaml
32+
envs:
33+
- name: production
34+
auto_merge: false
35+
required_contexts:
36+
- "publish-image" # The commit status of building the artifact.
37+
production_environment: true
38+
```
39+
40+
## Questions?
41+
42+
We are always happy to help with questions you might have. You can post questions or comments to our [community](https://github.com/gitploy-io/gitploy/discussions).
43+
44+
And we are very welcome to share your deployment pipeline at our [community](https://github.com/gitploy-io/gitploy/discussions).

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ nav:
2525
- Tasks:
2626
- Installation: tasks/installation.md
2727
- Database: tasks/database.md
28-
- "First Deployment": tasks/first-deployment.md
28+
- "Use Cases": tasks/usecases.md
2929
- Integration: tasks/integration.md
3030
- References:
3131
- Configurations: references/configurations.md

0 commit comments

Comments
 (0)