artifact not created

Daniel Verman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 22, 2023

hi i have a small pipeline:
on merging a PR to master 1)copy branch files into some tmp folder/create it as an artifact and 2)upload folder*files into s3 bucket.



i saw the files in the folder /tmp/artifact but no artifact was create and therfore its failed on deploy step, any ideas?


pipelines:
 branches:
  master:
   - step:
     name: Build Artifact
     script:
      - pwd
      - ls
      - mkdir -p /tmp/artifact
      - cp -r * /tmp/artifact -v
      - ls -l /tmp/artifact

    artifacts:
     - '/tmp/artifact/**'


  - step:
      name: Deploy to S3
      deployment: production
      script:
       - pipe: atlassian/aws-s3-deploy:0.3.8
         variables:
        AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
        AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
        AWS_DEFAULT_REGION: 'us-east-1'
        S3_BUCKET: 'test_bucket' #test
        LOCAL_PATH: /tmp/artifact



1 answer

1 vote
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 23, 2023

Hey Daniel,

Welcome to Atlassian Community!

According to the Pipelines artifacts documentation

Files that are in the BITBUCKET_CLONE_DIR at the end of a step can be configured as artifacts. The BITBUCKET_CLONE_DIR is the directory in which the repository was initially cloned.

This means that files created outside the BITBUCKET_CLONE_DIR will not be uploaded as artifacts.

The solution, in this case, would be to create your artifact folder inside the BITBUCKET_CLONE_DIR, move the required files to that folder, and specify that folder as an artifact in your step, as in the example below : 

pipelines:
 branches:
  master:
   - step:
     name: Build Artifact
     script:
      - mkdir -p my_artifacts
      - cp -r * my_artifacts -v
    artifacts:
     - 'my_artifacts/**'

 

Artifact paths are already relative to the BITBUCKET_CLONE_DIR, this is the reason in the example we haven't specified the full path.

 

Hope that helps! Let me know in case you have any questions.

 

Thank you, @Daniel Verman !

 

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events