From 43887546d3a606a8f073d9e00618b6501160fdb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=85=E6=B2=BB=E6=98=8E=E5=8D=83=E6=A0=91=E6=B1=90?= Date: Sat, 3 Sep 2022 01:28:02 +0800 Subject: [PATCH] fix: ci bug --- .gitlab-ci.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a2c1156..9d44507 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,10 +42,11 @@ composer-install: upload: stage: upload tags: - - windows10shell + - windowsserver2022powershell rules: - if: $CI_COMMIT_TAG script: + - ${webrootDir} = "D:\wwwroot\downloadserver.soraharu.com\OpenNav\${CI_COMMIT_TAG}\"; - ${nodeModulesDirArray} = "blueimp-md5\js", "bootstrap\dist", @@ -63,8 +64,17 @@ upload: Move-Item ".\node_modules\${nodeModulesDir}\*" ".\Public\node_modules\${nodeModulesDir}\"; } - Remove-Item ".\node_modules\" -Recurse; - - PowerShell -Command "& {7z a .\OpenNav-compiled.zip .\*}"; - - Move-Item ".\OpenNav-compiled.zip" "D:\wwwroot\downloadserver.soraharu.com\OpenNav\${CI_COMMIT_TAG}\"; + - Set-Location "..\"; + - if (Test-Path -Path ".\OpenNav-compiled.zip" -PathType Leaf) { + Remove-Item ".\OpenNav-compiled.zip" -Recurse; + } + - PowerShell -Command "& {7z a .\OpenNav-compiled.zip .\OpenNav\*}"; + - if (Test-Path -Path "${webrootDir}") { + Remove-Item "${webrootDir}*" -Recurse; + } else { + New-Item -Path "${webrootDir}" -ItemType Directory; + } + - Move-Item ".\OpenNav-compiled.zip" "${webrootDir}"; ######################### # Release #