gitlab-ci 配合asp.net core项目

asp.net core 项目配置

stages:
    - deploy

deploy_dev_job:
    stage: deploy
    environment:
        name: development
    only:
        - dev
    script:
        # 发布程序并部署运行
        - dotnet publish ./Api/Api.csproj -c Release --output /home/gittmp
        - cp -r /home/gittmp/* /home/web2/

asp.net core +docker 配置

image: microsoft/aspnetcore-build
stages:
    - deploy

deploy_dev_job:
    stage: deploy
    environment:
        name: development
    only:
        - dev
    script:
        - docker build -t petnet .
        - docker rm -f petnet
        - docker run -d -p6000:5000 --mount source=petnetpublish,target=/app --mount source=petnetupload,target=/app/upload --restart=always --name petnet petnet

asp.net 配置

    stages:
    - deploy

    deploy_dev_job:
        stage: deploy
        only:
            - master
        script:
            - C:\nuget.exe restore
            - C:\MSBuild.exe .\ControlCenter.sln /t:Rebuild /p:outdir=D:\publish\controlcenter /p:Configuration=Release /p:Platform="Any CPU"

发表评论

电子邮件地址不会被公开。

1 × 3 =