setup drone server
This commit is contained in:
parent
98a9a88740
commit
5f0d0cb503
6 changed files with 60 additions and 2 deletions
6
.env.example
Normal file
6
.env.example
Normal file
|
@ -0,0 +1,6 @@
|
|||
DRONE_GITEA_SERVER=https://git.fogtype.com/
|
||||
DRONE_GITEA_CLIENT_ID=
|
||||
DRONE_GITEA_CLIENT_SECRET=
|
||||
DRONE_RPC_SECRET=
|
||||
DRONE_SERVER_HOST=gamma.fogtype.com
|
||||
DRONE_SERVER_PROTO=https
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.env
|
28
README.md
28
README.md
|
@ -1,12 +1,36 @@
|
|||
# γ
|
||||
|
||||
[git.fogtype.com](https://git.fogtype.com/) 用 Drone Server & Runner
|
||||
|
||||
## Setup
|
||||
|
||||
```sh
|
||||
sudo apt install ansible docker-ce
|
||||
ansible-playbook setup.yml
|
||||
docker context create --docker=host=ssh://ubuntu@beta.fogtype.com beta
|
||||
docker context create --docker=host=ssh://ubuntu@gamma.fogtype.com gamma
|
||||
```
|
||||
|
||||
詳しい構成は [setup.yml](setup.yml) を参照
|
||||
|
||||
## Drone Server
|
||||
|
||||
Gitea への導入
|
||||
: https://docs.drone.io/server/provider/gitea/
|
||||
|
||||
| 項目 | 値 |
|
||||
| ---------------- | ------------------------------- |
|
||||
| Application Name | gamma |
|
||||
| Redirect URI | https://gamma.fogtype.com/login |
|
||||
|
||||
```bash
|
||||
install -m 600 .env{.example,}
|
||||
echo DRONE_RPC_SECRET=$(openssl rand -hex 16) >> .env
|
||||
# .envファイルに適切な設定をする
|
||||
```
|
||||
|
||||
### Deploy
|
||||
|
||||
```bash
|
||||
docker context create --docker=host=ssh://ubuntu@gamma.fogtype.com gamma
|
||||
docker context use gamma
|
||||
docker compose up -d
|
||||
```
|
||||
|
|
19
compose.yml
Normal file
19
compose.yml
Normal file
|
@ -0,0 +1,19 @@
|
|||
services:
|
||||
drone:
|
||||
image: drone/drone:2
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
environment:
|
||||
DRONE_TLS_AUTOCERT: "true"
|
||||
DRONE_GITEA_SERVER: ${DRONE_GITEA_SERVER:?}
|
||||
DRONE_GITEA_CLIENT_ID: ${DRONE_GITEA_CLIENT_ID:?}
|
||||
DRONE_GITEA_CLIENT_SECRET: ${DRONE_GITEA_CLIENT_SECRET:?}
|
||||
DRONE_RPC_SECRET: ${DRONE_RPC_SECRET:?}
|
||||
DRONE_SERVER_HOST: ${DRONE_SERVER_HOST:?}
|
||||
DRONE_SERVER_PROTO: ${DRONE_SERVER_PROTO:?}
|
||||
volumes:
|
||||
- drone_data_v2:/data
|
||||
volumes:
|
||||
drone_data_v2:
|
4
etc/docker/daemon.json
Normal file
4
etc/docker/daemon.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"live-restore": true,
|
||||
"log-driver": "journald"
|
||||
}
|
|
@ -13,6 +13,10 @@
|
|||
become: true
|
||||
environment:
|
||||
GCLOUD_API_KEY: "{{ grafana_gcloud_api_key }}"
|
||||
- ansible.builtin.copy:
|
||||
src: etc/docker/
|
||||
dest: /etc/docker/
|
||||
become: true
|
||||
- ansible.builtin.apt_repository:
|
||||
filename: docker
|
||||
repo: deb [trusted=yes] https://download.docker.com/linux/ubuntu jammy stable
|
||||
|
|
Reference in a new issue