From f639962b68ce341709b58b67e28f36007e3c5e88 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 11 Jul 2024 15:27:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=93=E5=8C=85=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E9=85=8D=E7=BD=AE=E9=95=9C=E5=83=8Fbug=20=E5=8F=91?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Document/TrialEmailNoticeConfigService.cs | 2 +- IRaCIS.Core.Domain.Share/NetResource.cs | 50 ------ irc_api.drone.yml | 162 +++++++++--------- 3 files changed, 82 insertions(+), 132 deletions(-) delete mode 100644 IRaCIS.Core.Domain.Share/NetResource.cs diff --git a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs index ec7c73af0..312561504 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs @@ -23,9 +23,9 @@ using System.Linq; using Spire.Doc; using Microsoft.AspNetCore.Http; using System; -using System.Runtime.InteropServices; using SharpCompress.Common; using SkiaSharp; +using System.Runtime.InteropServices; namespace IRaCIS.Core.Application.Service { diff --git a/IRaCIS.Core.Domain.Share/NetResource.cs b/IRaCIS.Core.Domain.Share/NetResource.cs deleted file mode 100644 index 85834fc3e..000000000 --- a/IRaCIS.Core.Domain.Share/NetResource.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.Runtime.InteropServices; - -namespace IRaCIS.Core.Domain.Share -{ - [StructLayout(LayoutKind.Sequential)] - public class NetResource - { - public int dwScope; - public int dwType; - public int dwDisplayType; - public int dwUsage; - public string lpLocalName; - public string lpRemoteName; - public string lpComment; - public string lpProvider; - } - - - public class WNetAddConnectionHelper - { - [DllImport("mpr.dll", EntryPoint = "WNetAddConnection2")] - private static extern uint WNetAddConnection2(NetResource lpNetResource, string lpPassword, string lpUsername, uint dwFlags); - - [DllImport("mpr.dll")] - public static extern int WNetCancelConnection2A(string sharename, int dwFlags, int fForce); - - public static void Connect() - { - - var remoteName = @"\\192.168.1.119\Potomac_01"; - NetResource netResource = new NetResource(); - netResource.dwScope = 1; - netResource.dwType = 1; - netResource.dwDisplayType = 3; - netResource.dwUsage = 1; - netResource.lpLocalName = "W:"; - netResource.lpRemoteName = remoteName.TrimEnd('\\'); - - WNetAddConnection2(netResource, "Everest@suzhou406", "share", 1); - - } - - public static int Disconnect() - { - return WNetCancelConnection2A("W:", 1, 1); - } - - } -} - diff --git a/irc_api.drone.yml b/irc_api.drone.yml index bc47b4ba2..55df5dea8 100644 --- a/irc_api.drone.yml +++ b/irc_api.drone.yml @@ -1,82 +1,30 @@ kind: pipeline -type: docker -name: irc-netcore-api +type: ssh +name: ssh-linux-uat-irc-build-image +platform: + os: Linux + arch: 386 + clone: - disable: true #禁用默认克隆 + disable: true + +server: + host: 47.117.164.182 + user: root + password: + from_secret: test_ssh_pwd steps: -- name: clone-repo - image: alpine/git - pull: if-not-exists - volumes: - - name: irc-test-work - path: /work +- name: build-uat-irc commands: - - if [ ! -e /work/netcore-repo/.git ]; then - git clone -b Test.IRC http://192.168.3.68:2000/XCKJ/irc-netcore-api.git /work/netcore-repo; - else - cd /work/netcore-repo; - git pull; - fi - - - | - if [ ! -e Dockerfile ]; then - echo 'FROM mcr.microsoft.com/dotnet/aspnet:6.0 - EXPOSE 80 - WORKDIR /app - COPY publish . - ENTRYPOINT ["dotnet", "IRaCIS.Core.API.dll"]' > /work/Dockerfile - fi - -- name: restore-publish - image: mcr.microsoft.com/dotnet/sdk:6.0 - pull: if-not-exists - depends_on: - - clone-repo - volumes: - - name: nuget-packages - path: /root/.nuget/packages - - name: irc-test-work - path: /work - commands: - - cd /work/netcore-repo/IRaCIS.Core.API - - dotnet restore ./IRaCIS.Core.API.csproj - - rm -rf /work/publish - - cd /work/netcore-repo/IRaCIS.Core.API - - dotnet publish ./IRaCIS.Core.API.csproj -c Release --no-restore -o /work/publish - - -- name: docker-build - image: docker - pull: if-not-exists - depends_on: - - restore-publish - commands: - - cd /work - - docker build -t test-irc:v${DRONE_BUILD_NUMBER} . - volumes: - - name: irc-test-work - path: /work - - name: dockersock - path: /var/run/docker.sock - - -volumes: - - name: nuget-packages - host: - path: /opt/cicd/nuget/packages - - name: irc-test-work - host: - path: /opt/cicd/irc-test - - name: dockersock - host: - path: /var/run/docker.sock - + - cd /opt/1panel/xc-deploy/Uat_IRC/devops-build-publish/Uat-To-Uat + - sh pull-build-uat-irc-image.sh v${DRONE_BUILD_NUMBER} + trigger: branch: - - master - + - Uat_IRC_Net8 + --- kind: pipeline type: ssh @@ -87,8 +35,8 @@ platform: arch: 386 clone: - disable: true #禁用默认克隆 - + disable: true + server: host: 106.14.89.110 user: root @@ -98,17 +46,13 @@ server: steps: - name: publish-test-irc commands: - - echo start publish test-irc-api - - cd /opt/1panel/hang/devops/test-irc - - sh test-irc.sh v${DRONE_BUILD_NUMBER} + - cd /opt/1panel/xc-deploy/Test_IRC/devops-build-publish;sh test-irc-update-or-create-stack.sh v${DRONE_BUILD_NUMBER} trigger: branch: - - Test.IRC + - Test_IRC_Net8 --- - - kind: pipeline type: ssh name: ssh-linux-test-study-publish @@ -129,12 +73,68 @@ server: steps: - name: publish-test-study commands: - - echo start publish test-study-api - - cd /opt/1panel/hang/devops/test-study + - cd /opt/1panel/xc-deploy/Test_Study/devops-build-publish - sh test-study.sh v${DRONE_BUILD_NUMBER} trigger: branch: - Test.Study + +--- +kind: pipeline +type: ssh +name: ssh-linux-test-scp-publish + +platform: + os: Linux + arch: 386 + +clone: + disable: true #禁用默认克隆 + +server: + host: 106.14.89.110 + user: root + password: + from_secret: test_ssh_pwd + +steps: +- name: publish-test-hir-scp + commands: + - cd /opt/1panel/xc-deploy/Test_HIR_SCP/devops-build-publish;sh pull-build-test-hir-scp-image.sh v${DRONE_BUILD_NUMBER} + - cd /opt/1panel/xc-deploy/Test_HIR_SCP ;sh update-image-if-need-then-pull-aliyun.sh v${DRONE_BUILD_NUMBER} +trigger: + branch: + - Test_HIR + + +--- + + +kind: pipeline +type: ssh +name: ssh-linux-test-hir-publish + +platform: + os: Linux + arch: 386 + +clone: + disable: true #禁用默认克隆 + +server: + host: 106.14.89.110 + user: root + password: + from_secret: test_ssh_pwd + +steps: +- name: publish-test-hir + commands: + - cd /opt/1panel/xc-deploy/Test_HIR/devops-build-publish;sh pull-build-test-hir-image.sh v${DRONE_BUILD_NUMBER} + - cd /opt/1panel/xc-deploy/Test_HIR ; sh update-image-if-need-then-pull-aliyun.sh v${DRONE_BUILD_NUMBER} +trigger: + branch: + - Test_HIR \ No newline at end of file