This commit is contained in:
Baohua Yang
2026-02-09 12:56:12 -08:00
parent 63377d0431
commit b44c9acd6c
228 changed files with 326 additions and 271 deletions

View File

@@ -0,0 +1,19 @@
kind: pipeline
type: docker
name: build
steps:
- name: build
image: golang:alpine
pull: if-not-exists # always never
environment:
KEY: VALUE
commands:
- echo $KEY
- pwd
- ls
- CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
- ./app
trigger:
branch:
- master

View File

@@ -0,0 +1,22 @@
# Drone CI Demo 项目
这是一个基于 Go 语言编写的简单 Web 应用示例用于演示 Drone CI 的持续集成流程
## 目录结构
* `app.go`: 简单的 Go Web 服务器代码
* `.drone.yml`: Drone CI 的配置文件定义了构建和测试流程
* `Dockerfile`: 定义了如何将该应用构建为 Docker 镜像
## 如何运行
1. 确保本地已安装 Docker 环境
2. 进入本目录构建镜像
```bash
docker build -t drone-demo-app .
```
3. 运行容器
```bash
docker run -p 8080:8080 drone-demo-app
```
4. 访问 `http://localhost:8080` 查看效果

View File

@@ -0,0 +1,7 @@
package main
import "fmt"
func main(){
fmt.Printf("Hello World!\n");
}