Artifacts being wiped away at next stage

1,239 views
Skip to first unread message

Andrew Mattie

unread,
Aug 21, 2016, 3:53:14 AM8/21/16
to GitLab
When I try to pass artifacts between stages, it _feels_ like I'm doing the right thing, but it's not working because git itself keeps wiping away my artifacts in later stages.

I'm using GitLab v8.10.6-ee and runners running v1.4.2.

Here's a truncated version of my .gitlab-ci.yml:

----------

stages:
  - build
  - test

variables:
  DOTNET_RUNTIME: debian.8-x64

##########
# build
##########

build:
  stage: build
  image: microsoft/dotnet:1.0.0-preview2-sdk
  script:
    - cd "$CI_PROJECT_DIR"
    - git submodule init
    - git submodule update
    - dotnet restore
    - dotnet build -c Release **/project.json
  artifacts:
    untracked: true
    expire_in: 1 week
    paths:
      - src
      - test
      - vendor

##########
# test
##########

test:
  stage: test
  image: microsoft/dotnet:1.0.0-preview2-sdk
  script:
    - find test -maxdepth 1 -type d ! -path test -print0 | xargs -0 -n 1 dotnet test

----------

Here's the output of the 'build' build:

----------

Running with gitlab-ci-multi-runner 1.4.2 (5a8552b)
Using Docker executor with image microsoft/dotnet:1.0.0-preview2-sdk ...
Pulling docker image microsoft/dotnet:1.0.0-preview2-sdk ...
Running on runner-be73a704-project-111-concurrent-0 via ip...
Fetching changes...
Removing src/xxx/bin/
[...]
HEAD is now at 7ebe38d CI testing
   7ebe38d..6f4ce6c  master     -> origin/master
Checking out 6f4ce6cc as master...
$ cd "$CI_PROJECT_DIR"
[...]
Uploading artifacts...
src: found 198 matching files                      
test: found 121 matching files                     
vendor: found 855 matching files                   
untracked: found 158 files                         
Uploading artifacts to coordinator... ok            id=2002 responseStatus=201 Created token=CbomMJer
Build succeeded

----------

Here's the output of the 'test' build:

----------

Running with gitlab-ci-multi-runner 1.4.2 (5a8552b)
Using Docker executor with image microsoft/dotnet:1.0.0-preview2-sdk ...
Pulling docker image microsoft/dotnet:1.0.0-preview2-sdk ...
Running on runner-48a465ca-project-111-concurrent-0 via ip...
Fetching changes...
Removing src/xxx/bin/
[...]
Compilation failed.
    0 Warning(s)
    37 Error(s)

Time elapsed 00:00:00.0244089

SUMMARY: Total: 1 targets, Passed: 0, Failed: 1.
ERROR: Build failed: exit code 1

----------

It feels somewhat issue 1588, but with a slight twist since I'm not seeing the "was unexpected at this time" statement at the bottom.

Any help or advice?
Andrew

Andrew Mattie

unread,
Aug 22, 2016, 1:39:14 AM8/22/16
to GitLab
Got it figured out. I realized my artifacts were being extracted beneath all the cleanup, and my problem was in something else.

Drew Blessing

unread,
Aug 23, 2016, 5:51:06 PM8/23/16
to GitLab
Hi Andrew,

I believe you need to add `dependencies` in your secondary stage. See http://docs.gitlab.com/ce/ci/yaml/README.html#dependencies for more information. This page does say that artifacts should implicitly be passed among stages so maybe there is a bug here. Give the `dependencies` a try and based on your results we can decide whether to file a bug or not. 

Drew Blessing

unread,
Aug 23, 2016, 5:51:30 PM8/23/16
to GitLab
Whoops! Just saw your second note. I'm glad you figured it out!
Reply all
Reply to author
Forward
0 new messages