feat(CI): 测试推送到Nexus3
continuous-integration/drone Build is failing Details

develop
Yosheng 2023-08-05 17:33:47 +08:00
parent 8d75ec84e0
commit 9376c4b14e
4 changed files with 32 additions and 14 deletions

View File

@ -1,8 +1,24 @@
kind: pipeline # 定义一个管道 kind: pipeline
type: docker # 当前管道的类型 type: docker
name: test # 当前管道的名称 name: deployment
steps: # 定义管道的执行步骤 steps:
- name: test # 步骤名称 - name: check
image: node:latest # 当前步骤使用的镜像 image: alpine
commands: # 当前步骤执行的命令 commands:
- echo 测试drone执行 - ls -la
- ls -la Dockerfile --查看当前文件夹是否包含了Dockerfile
- name: publish
image: plugins/docker
settings:
dockerfile: Dockerfile
tags: latest
# you need insecure: true since we don't have a TLS certificate
insecure: true
registry: 192.168.31.104:8082
repo: 192.168.31.104:8082/tiamo/user-point-management
# create the docker_username and docker_password secrets in Drone, with Nexus' username & password
secrets: [ drone, dronepw ]
#trigger:
# branch:
# - master

View File

@ -63,7 +63,8 @@ public class UserService : IUserService
public async Task CreateUser(User input) public async Task CreateUser(User input)
{ {
await using var _userPointManagementDbContext = await _dbContextFactory.CreateDbContextAsync(); await using var _userPointManagementDbContext = await _dbContextFactory.CreateDbContextAsync();
if (!string.IsNullOrWhiteSpace(input.Mobile) && _userPointManagementDbContext.Users.Any(x => x.Mobile == input.Mobile)) if (!string.IsNullOrWhiteSpace(input.Mobile) &&
_userPointManagementDbContext.Users.Any(x => x.Mobile == input.Mobile))
{ {
throw new ArgumentException("手机号不可重复!"); throw new ArgumentException("手机号不可重复!");
} }
@ -72,6 +73,7 @@ public class UserService : IUserService
{ {
throw new ArgumentException("名称不可重复!"); throw new ArgumentException("名称不可重复!");
} }
_userPointManagementDbContext.Users.Add(input); _userPointManagementDbContext.Users.Add(input);
await _userPointManagementDbContext.SaveChangesAsync().ConfigureAwait(false); await _userPointManagementDbContext.SaveChangesAsync().ConfigureAwait(false);
} }