Commit 310c13a1 authored by 崔佳豪's avatar 崔佳豪

fix: update CI

parent 14ad1acc
Pipeline #56283 waiting for manual action with stages
variables: variables:
TARGET_REPO: "G:/CIV_CI/CivWebPublish2021_CIVWeb5/CivWebPublish2021/" TARGET_REPO_2021: "G:/CIV_CI/CivWebPublish2021_CIVWeb5/CivWebPublish2021/"
TARGET_REPO_Solution: "G:/CIV_CI/PandaSolution/civbase/"
GIT_STRATEGY: 'fetch' GIT_STRATEGY: 'fetch'
GIT_CHECKOUT: 'false' GIT_CHECKOUT: 'false'
before_script: before_script:
- chcp 65001 - chcp 65001
- 'git config core.autocrlf false' - 'git config core.autocrlf false'
...@@ -9,7 +12,8 @@ before_script: ...@@ -9,7 +12,8 @@ before_script:
stages: stages:
- install - install
- package - package
- push - push2021
- pushSolution
install: install:
stage: install stage: install
...@@ -38,7 +42,7 @@ package: ...@@ -38,7 +42,7 @@ package:
- echo "${CI_PROJECT_DIR}" - echo "${CI_PROJECT_DIR}"
- git pull origin master - git pull origin master
#- npm run init #- npm run init
- npm run build --releasepath=../CivWebPublish2021 - npm run build --releasepath=../PublishTemp
#cache: #cache:
# key: ${CI_COMMIT_REF_SLUG} # key: ${CI_COMMIT_REF_SLUG}
# paths: # paths:
...@@ -49,22 +53,22 @@ package: ...@@ -49,22 +53,22 @@ package:
when: manual when: manual
push: push2021:
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
stage: push stage: push2021
tags: tags:
- civ_base - civ_base
script: script:
- 'cd "${TARGET_REPO}"' - 'cd "${TARGET_REPO_2021}"'
- 'git reset --hard head' - 'git reset --hard head'
- 'git clean -fd' - 'git clean -fd'
- 'git remote set-url origin "https://${GIT_ACCESS_USER}:${GIT_ACCESS_PASSWORD}@g.civnet.cn:8443/CivPublish/CivWebPublish2021.git"' - 'git remote set-url origin "https://${GIT_ACCESS_USER}:${GIT_ACCESS_PASSWORD}@g.civnet.cn:8443/CivPublish/CivWebPublish2021.git"'
- 'git pull origin map --allow-unrelated-histories' - 'git pull origin map --allow-unrelated-histories'
#- 'git rm -rf "${TARGET_REPO}/civbase"' #- 'git rm -rf "${TARGET_REPO_2021}/civbase"'
#- 'git commit -m "chore: clear folder"' #- 'git commit -m "chore: clear folder"'
#- 'git push origin map' #- 'git push origin map'
- 'robocopy "${CI_PROJECT_DIR}/../CivWebPublish2021/civbase" "${TARGET_REPO}/civbase" /S ; - 'robocopy "${CI_PROJECT_DIR}/../PublishTemp/civbase" "${TARGET_REPO_2021}/civbase" /S ;
IF ((${LASTEXITCODE} -le 8)) {cmd /c "exit /b 0"}' IF ((${LASTEXITCODE} -le 8)) {cmd /c "exit /b 0"}'
- 'git add . ; git reset HEAD Web.config CityInterface/Web.config CityWebFW/Web.config ; git commit -m "auto package civbase."' - 'git add . ; git reset HEAD Web.config CityInterface/Web.config CityWebFW/Web.config ; git commit -m "auto package civbase."'
- 'git push origin map' - 'git push origin map'
...@@ -72,3 +76,25 @@ push: ...@@ -72,3 +76,25 @@ push:
only: only:
- master - master
when: on_success when: on_success
pushSolution:
variables:
GIT_STRATEGY: none
tags:
- civbase
stage: pushSolution
script:
- 'cd "${TARGET_REPO_Solution}"'
- 'git reset --hard head'
- 'git clean -fd'
- 'git remote set-url origin "https://${ACCESS_USER}:${ACCESS_PASSWORD}@g.civnet.cn:8443/PandaSolution/civbase.git"'
- 'git pull origin test'
- 'git rm -rf --ignore-unmatch "${TARGET_REPO_Solution}"'
- 'robocopy "${CI_PROJECT_DIR}/../PublishTemp/civbase" "${TARGET_REPO_Solution}" /S ;
IF ((${LASTEXITCODE} -le 8)) {cmd /c "exit /b 0"}'
- 'git add . ; git commit -m "auto package civbase."'
- 'git push origin test'
only:
refs:
- master
when: manual
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment