gitlab 提取补丁脚本

 

 

build-job:
  tags:
    - c++
  stage: build
  script:
    - 'setlocal'                                                  
    - 'chcp 65001'                                                 
    - 'del /s /q Server\*.pdb                                      || (call)    '
    - 'del /s /q Server\Log\*.*                                    ||  cd .    '
    - 'del /s /q Server\MapTemp\*.*                                ||  cd .       '
    - 'del /s /q Server\logs\*.*                                   ||  cd .        '
    - 'rem 7z.exe a AGVSystem.7z .\Server      '
    -  git.exe diff --name-only --diff-filter=ACM "Head^"  1>Pathches.txt
    - 'set /P "diff=" < Pathches.txt'  
    - 'git.exe archive --output=test.zip HEAD'                                 
    - 'git.exe archive --output=Patches.zip HEAD %diff% --add-file=Pathches.txt'
  artifacts:
    when: on_success
    paths:
      - '%CI_PROJECT_DIR%\test.zip'
      - '%CI_PROJECT_DIR%\Patches.zip'

 

posted @ 2022-09-22 10:27  wolbo  阅读(63)  评论(0编辑  收藏  举报