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

Commit aa6555c

Browse files
author
noah
committed
Merge branch 'main' of github.com:/gitploy-io/gitploy
2 parents ab5c0e2 + 756a1dd commit aa6555c

File tree

3 files changed

+109
-12
lines changed

3 files changed

+109
-12
lines changed

docs/tasks/database.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Database
2+
3+
Gitploy requires the use of a database backend for persistence. Gitploy uses an embedded SQLite database by default. This article provides alternate databases: MySQL and Postgres.
4+
5+
## MySQL
6+
7+
Gitploy supports mysql `5.6` and higher as the database engine. The below example demonstrates mysql database configuration. See the official driver [documentation](https://github.com/go-sql-driver/mysql#dsn-data-source-name) for more connection string details.
8+
9+
```
10+
GITPLOY_STORE_DRIVER=mysql
11+
GITPLOY_STORE_SOURCE=root:password@tcp(1.2.3.4:3306)/gitploy?parseTime=true
12+
```
13+
14+
## Postgres
15+
16+
Gitploy supports postgres on the following 4 versions: `10`, `11`, `12` and `13`. The below example demonstrates postgres database configuration. See the official driver [documentation](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING) for more connection string details.
17+
18+
```
19+
GITPLOY_STORE_DRIVER=postgres
20+
GITPLOY_STORE_SOURCE=postgres://root:[email protected]:5432/gitploy?sslmode=disable
21+
```

docs/tasks/installation.md

Lines changed: 87 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,7 @@ Figure) Github OAuth
1818

1919
![Github OAuth](../images/github-oauth.png)
2020

21-
## Step 2: Download
22-
23-
The server is distributed as a Docker image. The image is self-contained and does not have any external dependencies. We recommend to use the last version.
24-
25-
```
26-
docker pull gitployio/gitploy:0.2
27-
```
28-
29-
## Step 3: Configuration
21+
## Step 2: Configuration
3022

3123
The server is configured using environment variables. This article only configures with least environment. See [Configurations](../references/configurations.md) for a complete list of configuration options.
3224

@@ -42,7 +34,15 @@ Required string value configures the GitHub OAuth client id. This is used to aut
4234
* **GITPLOY_GITHUB_CLIENT_SECRET**:
4335
Required string value configures the GitHub OAuth client secret. This is used to authorize access to GitHub on behalf of a Gitploy user.
4436

45-
## Step 4: Start server
37+
## Step 3: Start server
38+
39+
### Docker
40+
41+
The server is distributed as a Docker image. The image is self-contained and does not have any external dependencies. We recommend to use the last version.
42+
43+
```
44+
docker pull gitployio/gitploy:0.3
45+
```
4646

4747
The server container can be started with the below command. The container is configured through environment variables.
4848

@@ -58,5 +58,80 @@ docker run \
5858
--restart=always \
5959
--detach=true \
6060
--name=gitploy \
61-
gitployio/gitploy:0.2
62-
```
61+
gitployio/gitploy:0.3
62+
```
63+
64+
### Kubernetes
65+
66+
The server can be started in Kubernetes with the below artifacts. The container is configured through environment variables.
67+
68+
And we’re also support the official Helm chart to install the server, check [here](https://github.com/gitploy-io/helm-chart) for details.
69+
70+
<details>
71+
<summary>Kubernetes YAML</summary>
72+
73+
```yaml
74+
apiVersion: v1
75+
kind: Service
76+
metadata:
77+
name: gitploy
78+
labels:
79+
app.kubernetes.io/name: gitploy
80+
spec:
81+
type: ClusterIP
82+
ports:
83+
- port: 80
84+
targetPort: http
85+
protocol: TCP
86+
name: http
87+
selector:
88+
app.kubernetes.io/name: gitploy
89+
---
90+
apiVersion: apps/v1
91+
kind: Deployment
92+
metadata:
93+
name: gitploy
94+
labels:
95+
app.kubernetes.io/name: gitploy
96+
spec:
97+
replicas: 1
98+
selector:
99+
matchLabels:
100+
app.kubernetes.io/name: gitploy
101+
template:
102+
metadata:
103+
labels:
104+
app.kubernetes.io/name: gitploy
105+
spec:
106+
containers:
107+
- name: gitploy-server
108+
image: "gitployio/gitploy:0.3"
109+
imagePullPolicy: IfNotPresent
110+
ports:
111+
- name: http
112+
containerPort: 80
113+
protocol: TCP
114+
# Fill out values of environments
115+
env:
116+
- name: GITPLOY_SERVER_HOST
117+
value: ""
118+
- name: GITPLOY_SERVER_PROTO
119+
value: ""
120+
- name: GITPLOY_GITHUB_CLIENT_ID
121+
value: ""
122+
- name: GITPLOY_GITHUB_CLIENT_SECRET
123+
value: ""
124+
```
125+
</details>
126+
127+
## Pro tips
128+
129+
### Persistence
130+
131+
Gitploy uses an embedded SQLite database by default, and it stores all of the data in a single file. For persistence, you have to attach the volume to the path of the database (i.e., [GITPLOY_STORE_SOURCE](../references/GITPLOY_STORE_SOURCE.md)) in the container. You can check the [example](https://docs.docker.com/get-started/05_persisting_data/#persist-the-todo-data) on how to mount the volume in Docker.
132+
133+
And if you need alternative database, MySQL and Postgres, you should check the [database](database.md) documentation.
134+
135+
### Security
136+
137+
The server receives the webhook through the internet, and it could be a security issue. So you probably want to limit requests to those coming from GitHub. To ensure your server is only receiving the expected GitHub request, you must configure the secret token. You can configure it by [GITPLOY_WEBHOOK_SECRET](../references/GITPLOY_WEBHOOK_SECRET.md).

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ nav:
1919
- License: concepts/license.md
2020
- Tasks:
2121
- Installation: tasks/installation.md
22+
- Database: tasks/database.md
2223
- "First Deployment": tasks/first-deployment.md
2324
- Integration: tasks/integration.md
2425
- References:

0 commit comments

Comments
 (0)