Compare commits

..

1 Commits
ma ... master

Author SHA1 Message Date
hsc 1e3557b515 refactor: 更新 hello.sh脚本
continuous-integration/drone/push Build encountered an error Details
- 移除了多余的空行
- 保留了 Dev-Go 版本信息
- 保留了 Hello World 输出
- 保留了作者信息
2025-04-07 17:41:37 +08:00
7 changed files with 8 additions and 97 deletions

View File

@ -4,7 +4,6 @@ name: default
steps:
- name: run-hello-script
image: docker.1ms.run/docker:latest # 必须指定基础镜像如alpine/bash
image: docker.1ms.run/alpine/java:latest # 必须指定基础镜像如alpine/bash
commands:
- chmod +x ./hello.sh
- ./hello.sh
- java -version

4
.gitignore vendored
View File

@ -1,4 +0,0 @@
/target
/.idea
/log.path_IS_UNDEFINED
/tmp

View File

@ -1,19 +0,0 @@
# 使用Alpine Linux作为基础镜像
FROM alpine:latest
# 设置作者标签
LABEL authors="18257"
# 安装必要的运行时依赖(如果有的话)
# 例如如果你的应用程序需要CGO支持你可能需要安装一些库
# RUN apk add --no-cache libc6-compat
# 将Go应用程序二进制文件复制到镜像中
# 假设你的Go应用程序二进制文件名为hello
COPY hello /app/hello
# 设置工作目录
WORKDIR /app
# 设置容器启动时运行的命令
ENTRYPOINT ["/app/hello"]

View File

@ -1,13 +0,0 @@
#!/bin/sh
# 构建Go应用程序
CGO_ENABLED=0 GOOS=linux go build -o hello ./hello.go
# 构建Docker镜像
docker build -t hello-app .
# 清理生成的二进制文件
rm hello
# 运行Docker容器
docker run --rm -p 8080:8080 hello-app

View File

@ -1,18 +1,3 @@
package main
import (
"fmt"
"net/http"
)
func helloHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, World!")
}
func main() {
http.HandleFunc("/", helloHandler)
fmt.Println("Starting server at port 8080")
if err := http.ListenAndServe(":8080", nil); err != nil {
fmt.Println(err)
}
}
fmt.Println("Hello, World!")
}

View File

@ -0,0 +1,4 @@
NAME="芒星DevOps指挥脚本"
VERSION="alpine"
echo "Welcome To NAME :${NAME}"

View File

@ -1,41 +0,0 @@
# 🚀 项目名称: 芒星DevOps指挥脚本
## 📝 简介
该项目主要用于测试Drone CI/CD的相关属性。通过这个项目您可以了解和测试Drone的各种功能和配置。
## 🛠️ 工具和依赖
- **Drone**: 一个开源的持续集成和持续交付平台。
- **Shell脚本**: 用于编写自动化任务。
- **Docker**: 用于构建和推送镜像。
## 📦 安装和配置
1. **安装Drone**: 按照[Drone官方文档](https://docs.drone.io/)进行安装。
2. **配置Drone**: 根据您的需求配置Drone的`.drone.yml`文件。
## 🧪 测试属性
- **Pipeline触发**: 测试不同的触发条件,如代码推送、定时任务等。
- **环境变量**: 测试环境变量的配置和使用。
- **插件**: 测试Drone的各种插件如通知插件、部署插件等。
- **缓存**: 测试构建缓存的配置和效果。
## 📜 文档和资源
- [Drone官方文档](https://docs.drone.io/)
- [Drone插件列表](https://plugins.drone.io/)
## 🤝 贡献
欢迎贡献代码和提出问题!请参考[贡献指南](CONTRIBUTING.md)。
## 📄 许可证
本项目采用[MIT许可证](LICENSE)。
### 说明文档内容:
1. **项目名称**:使用 🚀 表示项目启动和重要性。
2. **简介**:使用 📝 表示文档和说明。
3. **工具和依赖**:使用 🛠️ 表示工具和依赖项。
4. **安装和配置**:使用 📦 表示安装包和配置。
5. **使用方法**:使用 🚀 表示启动和运行。
6. **测试属性**:使用 🧪 表示测试和实验。
7. **文档和资源**:使用 📜 表示文档和资源。
8. **贡献**:使用 🤝 表示合作和贡献。
9. **许可证**:使用 📄 表示法律和许可证。