diff --git a/frameworks/test-hello/2.0/Dockerfile b/frameworks/test-hello/2.0/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..5991219cbd0b5576b5e3482679191ad4a000bfad --- /dev/null +++ b/frameworks/test-hello/2.0/Dockerfile @@ -0,0 +1,8 @@ +FROM opencloudos/opencloudos9-minimal:latest + +LABEL maintainer="ZoeDong " +LABEL org.opencontainers.image.description="CI pipeline test image (versioned dir)" + +RUN dnf install -y python3 && dnf clean all + +CMD ["python3", "-c", "print('Hello from OpenCloudOS 9 v2.0!')"] diff --git a/frameworks/test-hello/2.0/README.md b/frameworks/test-hello/2.0/README.md new file mode 100644 index 0000000000000000000000000000000000000000..31d11f24caa9bb2b992b627b8677b3b7a29d4d36 --- /dev/null +++ b/frameworks/test-hello/2.0/README.md @@ -0,0 +1,21 @@ +# test-hello v2.0 on OpenCloudOS 9 + +> 三级目录结构测试用例(frameworks/test-hello/2.0/) + +## 基本信息 +- **镜像名**: test-hello +- **版本**: 2.0 +- **基础镜像**: opencloudos/opencloudos9-minimal:latest +- **用途**: 验证多版本目录 + build.conf 的 CI 流程 + +## 构建 + +```bash +docker build -t test-hello:2.0 frameworks/test-hello/2.0/ +``` + +## 使用 + +```bash +docker run --rm test-hello:2.0 +``` diff --git a/frameworks/test-hello/2.0/build.conf b/frameworks/test-hello/2.0/build.conf new file mode 100644 index 0000000000000000000000000000000000000000..c613be6fa542407eeb30ef052018f63ec71ffecf --- /dev/null +++ b/frameworks/test-hello/2.0/build.conf @@ -0,0 +1,3 @@ +IMAGE_NAME=test-hello +IMAGE_TAG=2.0 +GPU_TEST=false diff --git a/frameworks/test-hello/2.0/test.sh b/frameworks/test-hello/2.0/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..bd0b5cdd5fa0a6512eff64d37456975e0edbdb6e --- /dev/null +++ b/frameworks/test-hello/2.0/test.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +IMAGE="${1:?ERROR: Missing image parameter. Usage: bash test.sh }" + +echo "=== test-hello v2.0 CI test ===" +docker system prune -f +echo -n "Check python3 available... " +sudo docker run --rm "$IMAGE" python3 --version && echo "✓ passed" || { echo "✗ failed"; exit 1; } + +echo -n "Check hello output... " +OUTPUT=$(sudo docker run --rm "$IMAGE") +if echo "$OUTPUT" | grep -q "Hello from OpenCloudOS 9 v2.0"; then + echo "✓ passed" +else + echo "✗ failed: unexpected output: $OUTPUT" + exit 1 +fi + +echo "=== All tests passed ==="