ABP模块签入GitLab后自动打包并推送到ProGet
# 1、添加一个名为下划线的解决方案文件夹

# 2、把解决方案根目录下的几个必要的文件添加到上述文件夹下


# 3、修改NuGet.Config,添加私有NuGet服务器的网址,并配置用户名和密码:
ABP Suite模板生成的NuGet.Config是这样的:

添加一行自己服务器的配置,另外有对应的节点设置用户名和密码:

#4、在解决方案根目录创建文件.gitlab-ci.yml

文件内容如下图所示:

为方便大家复制,代码块如下:
# This file is a template, and might need editing before it works on your project.
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml # This is a sample GitLab CI/CD configuration file that should run without any modifications.
# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts,
# it uses echo commands to simulate the pipeline execution.
#
# A pipeline is composed of independent jobs that run scripts, grouped into stages.
# Stages run in sequential order, but jobs within stages run in parallel.
#
# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages stages: # List of stages for jobs, and their order of execution
- build
- test
- deploy
- update-version
- trigger-other-project variables:
CONFIG_VERSION_ID : 2023.51.$CI_PIPELINE_IID
NEXUS_REPO : https://proget.abcdefg.cn/nuget/Study/
NUGET_API_KEY : aeceb210f5irikfjskfiiiwoirwiirrie6a84817e68147
CONFIG_NUPKG_OUTPUT_DIR : /home/gitlab-runner/nupkg/study/trade
# Use no compression for caches
CACHE_COMPRESSION_LEVEL: "fastest" build-job: # This job runs in the build stage, which runs first.
stage: build
retry: 2
tags:
- shell
before_script:
- dotnet nuget locals plugins-cache --clear
script:
- echo "Compiling the code..."
- cd .
- dotnet build "src/Study.Trade.Application/Study.Trade.Application.csproj" -c Release --force -p:Version=$CONFIG_VERSION_ID
- dotnet build "src/Study.Trade.Application.Contracts/Study.Trade.Application.Contracts.csproj" -c Release --force -p:Version=$CONFIG_VERSION_ID
- dotnet build "src/Study.Trade.Blazor/Study.Trade.Blazor.csproj" -c Release --force -p:Version=$CONFIG_VERSION_ID
- dotnet build "src/Study.Trade.Blazor.Server/Study.Trade.Blazor.Server.csproj" -c Release --force -p:Version=$CONFIG_VERSION_ID
- dotnet build "src/Study.Trade.Blazor.WebAssembly/Study.Trade.Blazor.WebAssembly.csproj" -c Release --force -p:Version=$CONFIG_VERSION_ID
- dotnet build "src/Study.Trade.Domain/Study.Trade.Domain.csproj" -c Release --force -p:Version=$CONFIG_VERSION_ID
- dotnet build "src/Study.Trade.Domain.Shared/Study.Trade.Domain.Shared.csproj" -c Release --force -p:Version=$CONFIG_VERSION_ID
- dotnet build "src/Study.Trade.EntityFrameworkCore/Study.Trade.EntityFrameworkCore.csproj" -c Release --force -p:Version=$CONFIG_VERSION_ID
- dotnet build "src/Study.Trade.HttpApi/Study.Trade.HttpApi.csproj" -c Release --force -p:Version=$CONFIG_VERSION_ID
- dotnet build "src/Study.Trade.HttpApi.Client/Study.Trade.HttpApi.Client.csproj" -c Release --force -p:Version=$CONFIG_VERSION_ID
- dotnet build "src/Study.Trade.Web/Study.Trade.Web.csproj" -c Release --force -p:Version=$CONFIG_VERSION_ID
- dotnet pack "src/Study.Trade.Application/Study.Trade.Application.csproj" -c Release --no-build -o $CONFIG_NUPKG_OUTPUT_DIR -p:PackageVersion=$CONFIG_VERSION_ID
- dotnet pack "src/Study.Trade.Application.Contracts/Study.Trade.Application.Contracts.csproj" -c Release --no-build -o $CONFIG_NUPKG_OUTPUT_DIR -p:PackageVersion=$CONFIG_VERSION_ID
- dotnet pack "src/Study.Trade.Blazor/Study.Trade.Blazor.csproj" -c Release --no-build -o $CONFIG_NUPKG_OUTPUT_DIR -p:PackageVersion=$CONFIG_VERSION_ID
- dotnet pack "src/Study.Trade.Blazor.Server/Study.Trade.Blazor.Server.csproj" -c Release --no-build -o $CONFIG_NUPKG_OUTPUT_DIR -p:PackageVersion=$CONFIG_VERSION_ID
- dotnet pack "src/Study.Trade.Blazor.WebAssembly/Study.Trade.Blazor.WebAssembly.csproj" -c Release --no-build -o $CONFIG_NUPKG_OUTPUT_DIR -p:PackageVersion=$CONFIG_VERSION_ID
- dotnet pack "src/Study.Trade.Domain/Study.Trade.Domain.csproj" -c Release --no-build -o $CONFIG_NUPKG_OUTPUT_DIR -p:PackageVersion=$CONFIG_VERSION_ID
- dotnet pack "src/Study.Trade.Domain.Shared/Study.Trade.Domain.Shared.csproj" -c Release --no-build -o $CONFIG_NUPKG_OUTPUT_DIR -p:PackageVersion=$CONFIG_VERSION_ID
- dotnet pack "src/Study.Trade.EntityFrameworkCore/Study.Trade.EntityFrameworkCore.csproj" -c Release --no-build -o $CONFIG_NUPKG_OUTPUT_DIR -p:PackageVersion=$CONFIG_VERSION_ID
- dotnet pack "src/Study.Trade.HttpApi/Study.Trade.HttpApi.csproj" -c Release --no-build -o $CONFIG_NUPKG_OUTPUT_DIR -p:PackageVersion=$CONFIG_VERSION_ID
- dotnet pack "src/Study.Trade.HttpApi.Client/Study.Trade.HttpApi.Client.csproj" -c Release --no-build -o $CONFIG_NUPKG_OUTPUT_DIR -p:PackageVersion=$CONFIG_VERSION_ID
- dotnet pack "src/Study.Trade.Web/Study.Trade.Web.csproj" -c Release --no-build -o $CONFIG_NUPKG_OUTPUT_DIR -p:PackageVersion=$CONFIG_VERSION_ID
- echo "推送到Nexus 3服务器..."
- cd $CONFIG_NUPKG_OUTPUT_DIR
- dotnet nuget push *.$CONFIG_VERSION_ID.nupkg -k $NUGET_API_KEY -s $NEXUS_REPO
- echo "Application successfully deployed."
更新版本号: # This job runs in the test stage.
stage: update-version # It only starts when the job in the build stage completes successfully.
before_script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
#- ssh-keyscan $APP_SERVER > ~/.ssh/known_hosts
#- chmod 644 ~/.ssh/known_hosts
- cd /root/.ssh
- cp /home/gitlab-runner/ssh/* .
script:
- echo "部署到Brain测试站……"
- cd /home/gitlab-runner/scripts
#- ssh david@$APP_SERVER
#- docker ps
- bash update-version.sh "Directory.Build.Study.Trade.props" "Study_Trade_Version" $CONFIG_VERSION_ID 触发下游:
stage: trigger-other-project
trigger:
project: study/blazor-one
branch: main
# 4、把上述文件添加到解决方案文件夹下

# 5、签入代码
如果GitLab里面有Runner,就会自动打包并推送到ProGet了。
ABP模块签入GitLab后自动打包并推送到ProGet的更多相关文章
- Github自动打包并推送Nuget版本
如何将自己的类库,自动打包并自动发布到Nuget? 1. 项目csproject属性修改 新建一个项目GitToNugetPackageTest 不用添加任何类,我们修改csproject属性. 替换 ...
- CCNET+ProGet+Windows Batch搭建全自动的内部包打包和推送及管理平台
所要用的工具: 1.CCNET(用于检测SVN有改动提交时自动构建,并运行nuget的自动打包和推送批处理) 2.ProGet(目前见到最好用的nuget内部包管理平台) 3.Windows Batc ...
- 解放双手 | Jenkins + gitlab + maven 自动打包部署项目
前言 记录 Jenkins + gitlab + maven 自动打包部署后端项目详细过程! 需求背景 不会偷懒的程序员不是好码农,传统的项目部署,有时候采用本地手动打包,再通过ssh传到服务器部署运 ...
- 【MM系列】SAP MM模块-MIGO收货后自动打印收货单
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[MM系列]SAP MM模块-MIGO收货后自动 ...
- iOS打包后收不到推送信息
今天遇到的一个特别神奇的问题: 应用在测试环境下打的包收不到推送了,打包之后都没有推送,但是我真机测试又是可以收到推送消息的.经过好久才找到原因,感觉很坑.这里记录一下问题: 1.由于我的推送第三方使 ...
- Huginn实现自动通过slack推送豆瓣高分电影
博客搬迁至https://blog.wangjiegulu.com RSS订阅:https://blog.wangjiegulu.com/feed.xml 原文链接:https://blog.wang ...
- gitlab安装、下载、推送 代码(推荐)
环境: 内存必须5G以上 centos7.5 服务端:192.168.0.74 客户端:192.168.0.73 GitLab的安装 1.在CentOS系统上,下面的命令将会打开系统防火墙HTTP和S ...
- gitlab 已有代码仓库推送到另外一个gitlab仓库
创建一个新仓库 git clone ssh://git@gitlab.***************.git cd plt-calcium-report-web touch README.md git ...
- Jenkins+ProGet+Windows Batch搭建全自动的内部包(NuGet)打包和推送及管理平台
这一篇文章是继http://www.cnblogs.com/EasonJim/p/5954155.html的升级版,由于CCNET已经过时,所以我把打包过程的CCNET工具换成Jenkins去实现,批 ...
- 利用python对微信自动进行消息推送
from wxpy import * #该库主要是用来模拟与对接微信操作的 import requests from datetime import datetime import time impo ...
随机推荐
- [转帖] GC耗时高,原因竟是服务流量小?
原创:扣钉日记(微信公众号ID:codelogs),欢迎分享,转载请保留出处. 简介# 最近,我们系统配置了GC耗时的监控,但配置上之后,系统会偶尔出现GC耗时大于1s的报警,排查花了一些力气,故 ...
- 《Javascript高级程序设计》读书笔记——构造函数与原型
构造函数与原型 构造函数模式 最简单的构造函数: function Person(name, age, job) { this.name = name; this.age = age; this.jo ...
- vue 路由守卫是否携带token
//整个实例出来 配置路由守卫 const router = new Router({ //这里面是路由配置哈 }) router.beforeEach((to, from, next) => ...
- kettle(docker版)系列文章02---hello world
目标:将mysql库中表的数据定时转到另外一个表中 1.在mysql中新建目标表test_kettle,有字段id,productName,createtime 2.连接mysql数据库 DB连接-- ...
- Fabric网络升级(二)
原文来自这里. 如果想了解最新版Fabric的特殊事项,详见Upgrading to the latest release of Fabric. 本章只介绍更新Fabric组件的操作.关于如何通过编辑 ...
- chaincode中使用第三方库
本作品采用署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)进行许可,使用时请注明出处. 在fabric的chaincode开发时,有时候需要用到第三方库提供的功能.这 ...
- ABP .net Core 将日志打印在控制台
上效果图 来看一下操作流程: 一.分为.net Core 2.2 和 .net Core 3.0及以上 (一)..net Core 2.2 1.在 EntityFrameworkCore中安装Nuge ...
- 8.3 NtGlobalFlag
NtGlobalFlag 是一个Windows内核全局标记,在Windows调试方案中经常用到.这个标记定义了一组系统的调试参数,包括启用或禁用调试技术的开关.造成崩溃的错误代码和处理方式等等.通过改 ...
- LeetCode刷题日记 2020/03/26
题干 给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度. 示例 1: 输入: "abcabcbb" 输出: 3 解释: 因为无重复字符的最长子串是 "abc ...
- SpringCloud-05-Gateway
统一网关Gateway 1.为什么需要网关 网关功能: 身份认证和权限校验 服务路由.负载均衡 请求限流 2.网关的技术实现 在SpringCloud中网关的实现包括两种: gateway zuul ...