2017-03-22 5 views
3

빌드 중에 생성 된 디렉토리가 있으며 다음 빌드에서 삭제해서는 안됩니다. 나는 .gitlab-ci.yml에서 캐시를 사용하여 디렉토리를 유지하기 위해 노력하십시오 cache.zip가 생성되는 첫 번째 빌드에서디렉토리를 제거하지 않으려면 gitlab 러너를 중지하십시오.

cache: 
    key: "$CI_BUILD_REF_NAME" 
    untracked: true 
    paths: 
    - target_directory/ 
build-runner1: 
    stage: build 
    script: 
    - ./build-platform.sh target_directory 

하지만 다음 빌드를 위해 여기서 target_directory는 삭제되고 cache.zip 추출되는 아주 오랜 시간이 걸립니다.

Running with gitlab-ci-multi-runner 1.11. 
    on Runner1 
Using Shell executor... 
Running on Runner1... 
Fetching changes... 
Removing target_directory/ 
HEAD is now at xxxxx Update .gitlab-ci.yml 
From xxxx 
Checking out xxx as master... 
Skipping Git submodules setup 
Checking cache for master... 
Successfully extracted cache 

첫번째 장소에있는 디렉토리를 제거하지 주자 gitlab 방법이있다 : 여기에 두 번째 빌드의 로그는? 당신이 필요로하는 무엇

답변

3

작업 유물 사용하는 것입니다

유물 것은 성공적으로 완료 한 후 작업에 첨부 된 파일 및 디렉토리의 목록입니다.

.gitlab-ci.yml 파일 : 작업이 완료

your job: 
    before_script: 
     - do something 
    script: 
     - do another thing 
     - do something to generate your zip file (example: myFiles.zip) 
    artifacts: 
    paths: 
     - myFiles.zip 

후에는 작업의 특정 페이지를 방문하는 경우, 당신은 유물 아카이브를 다운로드 할 수있는 버튼이 있음을 알 수있다. 서로 다른 작업 사이에 유물을 통과해야하는 경우