Build artifact being collected automatically

A Question

According to doc here: https://circleci.com/docs/build-artifacts, One should use the $CIRCLE_ARTIFACTS env var to publish artifacts.

But, I have a case where simply copy a file to current dir (docker cp build-cont:/usr/local/gaia/target/mgs.war ./target/mgs.war) produce collected artifact:

On another case I have place where I did use $CIRCLE_ARTIFACTS (docker cp system-test-runner:/src/system-test-results.xml $CIRCLE_TEST_REPORTS/nodejs), but it seems like the env var was not being used:

  • Container 0
    • $CIRCLE_ARTIFACTS/
      - nodejs
      - python
    • $CIRCLE_TEST_REPORTS/
      - nodejs
      - python

Anyone knows by a chance to explain this behavior?

Thanks,
Shay