Storing folder in job artifacts

Hi, I want to store a folder into job artifact, I can only store the files in this folder.
cmd I am using into circleci.yml is : cp -r source_forder/ des/
I want to have the whole folder and its files in the artifacts.
Is it possible ? if yes how ?
Thank you

1 Like

Hi @lorasham,

Welcome to the CircleCI community!

There are a couple of options you could consider.

1. Add all files in the directory at once

Using the store_artifacts key, you can save all files in the folder as follows:

      - store_artifacts:
          path: path_to_folder/folder

With the above, all files in the folder will be saved as artifacts, and each one will be listed under the Artifacts tab as: path_to_folder/folder-filename

 
2. Archive (tar) the folder and save the archive as an artifact

Prior to the store_artifacts step you would need to create an archive of the folder and its content:

 tar -czf path_to_archive/archive.tar.gz path_to_folder/folder

Then:

      - store_artifacts:
          path: path_to_archive/archive.tar.gz
          destination: archived_folder

 
Let me know if this information helps.

2 Likes