Files
EasySoft-ZenTaoPMS/.gitfox/unittestforcommitid.yaml
T
2025-05-27 10:56:09 +08:00

59 lines
2.3 KiB
YAML

version: 1
kind: pipeline
spec:
stages:
- name: 单元测试
type: ci
spec:
clone:
depth: 100
vars:
- type: stage
name: prepare
steps:
- name: 构建测试镜像
type: run
spec:
container:
image: hub.zentao.net/ci/docker:24.0.8-cli
script:
- |
docker buildx create \
--name=kube \
--driver=kubernetes \
--driver-opt=namespace=quickon-ci,replicas=5,nodeselector="node-role.kubernetes.io/ci=true",rootless=true,image=hub.zentao.net/ci/moby-buildkit:buildx-stable-1-rootless,qemu.install=true,qemu.image=hub.zentao.net/ci/binfmt:qemu-v8.1.5
- docker buildx use kube
- docker buildx build --pull --push --platform linux/amd64 --build-arg VERSION=${ZENTAO_VERSION} --build-arg MIRROR=true -t hub.qc.oop.cc/zentao-ztf:${GITFOX_BUILD_NUMBER}-${GITFOX_COMMIT} -f misc/ci/Dockerfile.test .
- name: unit test
type: run
spec:
envs:
MYSQL_INTERNAL: "true"
container:
image: hub.qc.oop.cc/zentao-ztf:${{ build.number }}-${{ build.after }}
script:
- git rev-list $(git rev-parse origin/$GITFOX_TARGET_BRANCH )..$(git rev-parse HEAD)
- sh -c 'nohup /usr/bin/entrypoint.sh >/dev/null 2>&1 &'
- . /etc/s6/s6-init/envs
- sleep 5
- s6-svwait -u -t 30000 /etc/s6/s6-available/mysql
- initdb.php > /apps/zentao/unittestdb
- rununittestbycommitid.php zentaopms ${{ secrets.get("zentao_user") }} ${{ secrets.get("zentao_password") }}
- name: 消息通知
type: plugin
when: failure()
spec:
inputs:
debug: true
custom: true
token: ${{ secrets.get("xuan_token") }}
caller: zenci
api: https://gw.easycorp.cn
title: 单元测试
content: "单元测试执行失败"
url: ${GITFOX_BUILD_LINK}
users:
"0": "liyang"
"1": "{{.GITFOX_COMMIT_AUTHOR_NAME}}"
name: gitfox-xuanim-plugin