update
This commit is contained in:
parent
7d507dfa33
commit
0a84660d55
29
README.md
29
README.md
@ -1 +1,30 @@
|
|||||||
# drone and gitea
|
# drone and gitea
|
||||||
|
|
||||||
|
> 需在公网上部署
|
||||||
|
|
||||||
|
# 使用
|
||||||
|
|
||||||
|
## 管理 Gitea
|
||||||
|
### 启动 Gitea
|
||||||
|
```
|
||||||
|
./run.sh gitea start // or cd gitea && docker-compose up -d
|
||||||
|
```
|
||||||
|
### 停止 Gitea
|
||||||
|
```bash
|
||||||
|
./run.sh gitea stop // or cd gitea && docker-compose down
|
||||||
|
```
|
||||||
|
|
||||||
|
### 创建 OAuth 应用
|
||||||
|
> 参考链接, 参考 `Step 1:Preparation`部分
|
||||||
|
[Visit](https://docs.drone.io/server/provider/gitea/)
|
||||||
|
### Create a Shared Secret
|
||||||
|
```
|
||||||
|
openssl rand -hex 16
|
||||||
|
```
|
||||||
|
|
||||||
|
## edit `.env` file
|
||||||
|
|
||||||
|
|
||||||
|
## Run Drone Server
|
||||||
|
```
|
||||||
|
```
|
@ -1,49 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
services:
|
|
||||||
gitea:
|
|
||||||
image: gitea/gitea:1.10.1
|
|
||||||
ports:
|
|
||||||
- "80:3000"
|
|
||||||
- "522:22"
|
|
||||||
volumes:
|
|
||||||
- ./gitea:/data
|
|
||||||
environment:
|
|
||||||
- TZ=Asia/Shanghai
|
|
||||||
restart: always
|
|
||||||
networks:
|
|
||||||
- default
|
|
||||||
|
|
||||||
drone-server:
|
|
||||||
image: drone/drone:1
|
|
||||||
ports:
|
|
||||||
- "8000:80"
|
|
||||||
- 9000
|
|
||||||
volumes:
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
- ./drone/:/var/lib/drone
|
|
||||||
restart: always
|
|
||||||
networks:
|
|
||||||
- default
|
|
||||||
environment:
|
|
||||||
- DRONE_OPEN=true
|
|
||||||
- DRONE_SERVER_PROTO=http
|
|
||||||
- DRONE_SERVER_HOST=drone-server
|
|
||||||
# GITEA CONFIG
|
|
||||||
- DRONE_GITEA_SERVER=http://gitea:3000
|
|
||||||
- TZ=Asia/Shanghai
|
|
||||||
|
|
||||||
drone-agent:
|
|
||||||
image: drone/agent:1
|
|
||||||
container_name: drone-agent
|
|
||||||
volumes:
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
environment:
|
|
||||||
- DRONE_SERVER=drone-server:9000
|
|
||||||
- DRONE_SECRET=secret
|
|
||||||
- TZ=Asia/Shanghai
|
|
||||||
restart: always
|
|
||||||
networks:
|
|
||||||
- default
|
|
||||||
|
|
||||||
networks:
|
|
||||||
default:
|
|
12
drone/.env
Normal file
12
drone/.env
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
DRONE_GITEA_SERVER=http://127.0.0.1:3000
|
||||||
|
DRONE_GITEA_CLIENT_ID=29d717db-397a-4865-9854-d59f6ae0fcb8
|
||||||
|
DRONE_GITEA_CLIENT_SECRET=pZcM6cj0iE_WfZXzsxLfs_SlHtW82Vb0NcvMM2D73ZE=
|
||||||
|
DRONE_RPC_SECRET=fe41e7ac77fcbb22c3c4a832012f07bb
|
||||||
|
DRONE_SERVER_HOST=127.0.0.1:8000
|
||||||
|
DRONE_SERVER_PROTO=http
|
||||||
|
|
||||||
|
DRONE_RPC_PROTO=http
|
||||||
|
DRONE_RPC_HOST=127.0.0.1:8000
|
||||||
|
DRONE_RUNNER_CAPACITY=2
|
||||||
|
DRONE_RUNNER_NAME=drone-runner
|
43
drone/docker-compose.yml
Normal file
43
drone/docker-compose.yml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
drone:
|
||||||
|
image: drone/drone:1
|
||||||
|
container_name: drone
|
||||||
|
ports:
|
||||||
|
- "8000:80"
|
||||||
|
- 9000
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
- ./data/:/var/lib/drone
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
environment:
|
||||||
|
- 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}
|
||||||
|
- TZ=Asia/Shanghai
|
||||||
|
|
||||||
|
drone-runner:
|
||||||
|
image: drone/drone-runner-docker:1
|
||||||
|
container_name: drone-runner
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
environment:
|
||||||
|
- DRONE_RPC_PROTO=${DRONE_RPC_PROTO}
|
||||||
|
- DRONE_RPC_HOST=${DRONE_RPC_HOST}
|
||||||
|
- DRONE_RPC_SECRET=${DRONE_RPC_SECRET}
|
||||||
|
- DRONE_RUNNER_CAPACITY=${DRONE_RUNNER_CAPACITY}
|
||||||
|
- DRONE_RUNNER_NAME=${DRONE_RUNNER_NAME}
|
||||||
|
- TZ=Asia/Shanghai
|
||||||
|
depends_on:
|
||||||
|
- drone
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
|
||||||
|
networks:
|
||||||
|
default:
|
1
gitea/.gitignore
vendored
1
gitea/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
|
|
1
gitea/data/.gitignore
vendored
Executable file
1
gitea/data/.gitignore
vendored
Executable file
@ -0,0 +1 @@
|
|||||||
|
*
|
22
gitea/docker-compose.yml
Normal file
22
gitea/docker-compose.yml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
gitea:
|
||||||
|
image: gitea/gitea:1
|
||||||
|
container_name: gitea
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
|
- "3022:22"
|
||||||
|
volumes:
|
||||||
|
- /etc/timezone:/etc/timezone:ro
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
- ./data:/data
|
||||||
|
environment:
|
||||||
|
- USER_UID=1000
|
||||||
|
- USER_GID=1000
|
||||||
|
- TZ=Asia/Shanghai
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
|
||||||
|
networks:
|
||||||
|
default:
|
40
run.sh
Executable file
40
run.sh
Executable file
@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
help()
|
||||||
|
{
|
||||||
|
echo
|
||||||
|
echo "============================================"
|
||||||
|
echo "================ Miss Args ================"
|
||||||
|
echo "============================================"
|
||||||
|
echo "Run Gitea : ./run.sh gitea [start/stop]"
|
||||||
|
echo "Run Drone : ./run.sh drone [start/stop]"
|
||||||
|
echo "============================================"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
run()
|
||||||
|
{
|
||||||
|
|
||||||
|
if [ $2 == 'start' ] ;then
|
||||||
|
echo "start $1"
|
||||||
|
cd $1
|
||||||
|
docker-compose up -d
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $2 == 'stop' ] ;then
|
||||||
|
echo "stop $1"
|
||||||
|
cd $1
|
||||||
|
docker-compose down
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
help
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ ! -n "$1" -o ! -n "$2" ] ;then
|
||||||
|
help
|
||||||
|
fi
|
||||||
|
|
||||||
|
run $1 $2
|
Loading…
Reference in New Issue
Block a user