8 Star 2 Fork 1

小二、/crm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
.gitlab-ci.yml 3.42 KB
一键复制 编辑 原始数据 按行查看 历史
姓刘的人很忙 提交于 2024-02-05 18:12 +08:00 . 更新gitlab-ci
variables:
DOCKERHUB_HOST: swr.cn-east-3.myhuaweicloud.com
DOCKERHUB_USER: cn-east-3@R3N0LKJQRBOOAW66SMSM
NUGET_MIRROR: "http://mirrors.local.com/nuget/v3/index.json"
FEISHU_BOT: https://open.feishu.cn/open-apis/bot/v2/hook/05a5cfed-057c-4dc5-b6af-ba329c9704e6
stages:
- test
- prepare-build
- build-image
- deploy
test-code-job:
image: mcr.microsoft.com/dotnet/sdk:6.0
stage: test
# 在构建阶段缓存 NuGet 包
cache:
paths:
- ".nuget"
script:
- dotnet restore web.slnf --packages .nuget
- dotnet build web.slnf --no-restore
- dotnet test web.slnf --test-adapter-path:"." --logger:"junit;LogFilePath=$(pwd)\artifacts\{assembly}-test-result.xml;MethodFormat=Class;FailureBodyFormat=Verbose" --collect:"XPlat Code Coverage"
artifacts:
when: always
expire_in: 30 days
paths:
- ./**/*test-result.xml
- ./**/coverage.cobertura.xml
reports:
junit:
- ./**/*test-result.xml
coverage_report:
coverage_format: cobertura
path: ./**/coverage.cobertura.xml
build-custom-ui:
image: docker
stage: prepare-build
only:
- tags
script:
- BUILDED=$(docker images crm_ui:0.5.11 -q)
- |
if [[ -z $BUILDED ]]; then
sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
apk add git
git fetch --tags
git checkout tags/0.5.11
docker build ./web/SourceCode/VUE --add-host mirrors.local.com:192.168.2.2 -t crm_ui:0.5.11 \
--build-arg NPM_REGISTRY=http://mirrors.local.com/npm
else
echo "无需打包"
fi
build-image:
image: docker
stage: build-image
only:
- tags
cache:
key: apk-cache
paths:
- /var/cache/apk
# before_script:
# - which curl || apk add curl
script:
- echo $CI_COMMIT_TAG
- ./build-web.sh $CI_COMMIT_TAG
- echo "docker login -u $DOCKERHUB_USER -p $DOCKERHUB_PWD $DOCKERHUB_HOST"
- "[ ! -z $DOCKERHUB_PWD ] && docker login -u $DOCKERHUB_USER -p $DOCKERHUB_PWD $DOCKERHUB_HOST"
- docker push swr.cn-east-3.myhuaweicloud.com/erp4/crm:latest
- docker push swr.cn-east-3.myhuaweicloud.com/erp4/crm:$CI_COMMIT_TAG
# - 'curl -X POST -H "Content-Type: application/json" $FEISHU_BOT -d ''{"msg_type":"post","content":{"post":{"zh_cn":{"title":"项目打包通知","content":[[{"tag":"text","text":"版本[''"$CI_COMMIT_TAG"'']打包成功 "}]]}}}}'''
deploy-local:
image: mo5467/simple-deploy
stage: deploy
environment:
name: staging
url: http://crm.local.com:49156
script:
# - simple-deploy deploy --ssh-host root@192.168.1.2 --ssh-password $SSH_PASSWORD --docker-name crm$CI_COMMIT_TAG --docker-env CRM_ConnectionStrings__mysql='server=192.168.1.2;port=3306;database=crm_staging;uid=root;pwd=root;CharSet=utf8mb4' --docker-env ASPNETCORE_ENVIRONMENT='Staging' --docker-publish 49156:80 swr.cn-east-3.myhuaweicloud.com/erp4/crm:$CI_COMMIT_TAG
# - simple-deploy deploy --ssh-host root@192.168.2.2 --ssh-password $SSH_PASSWORD --docker-name crm$CI_COMMIT_TAG --docker-env CRM_ConnectionStrings__mysql='server=192.168.1.2;port=3306;database=crm_staging;uid=root;pwd=root;CharSet=utf8mb4' --docker-publish 49156:80 swr.cn-east-3.myhuaweicloud.com/erp4/crm:$CI_COMMIT_TAG
- echo "部署成功"
only:
- tags
deploy-production:
stage: deploy
only:
- tags
when: manual
environment:
name: production
url: http://crm.mimaosou.com/
script:
- echo "production"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/sml2/crm.git
git@gitee.com:sml2/crm.git
sml2
crm
crm
master

搜索帮助