Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Artifacts not uploaded

Abhinay Sutrakar July 31, 2022

Hi ,

 

We are trying to build simple maven project pipeline where we are trying to expect below actions to be happen.

Pipeline triggered and the artifacts to be uploaded in the target folder of current bitbucket repository path.

In the below example post pipeline trigger we are able to see results file  site/serenity/index.html  is generated at location during build but that file we would like to upload as artifacts in the target folder.

Even moving the file or directory not worked

 

image: radut/openjdk-15-maven

pipelines:
default:
- parallel:
- step:
name: Triggering Test Automation
script:
- mkdir –p $BITBUCKET_CLONE_DIR/target
- mvn clean install -f sps-api-automation/pom.xml -U
- cd /opt/atlassian/pipelines/agent/build/sps-api-automation/target
- cat site/serenity/index.html
- mv /opt/atlassian/pipelines/agent/build/sps-api-automation/target/site/serenity/index.html /opt/atlassian/pipelines/agent/build/sps-api-automation/target
artifacts:
- target/**

1 answer

0 votes
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 11, 2022

Hey Abhinay,

Artifacts are always relevant to the actual clone path ($BITBUCKET_CLONE_DIR) and therefore the cd/mv lines are not needed.

By default, you will always start within the clone directory. Therefore when making the target directory, if you simply run the following line - this will make a "target" directory within the clone directory:


mkdir target

When calling the directory later on in the artifacts line, you have the correct config (as this will point to $BITBUCKET_CLONE_DIR\target):

artifacts:

target/**

Try this configuration and then click on the "Artifacts" tab in the build itself to verify if the downloaded artifact is what you are expecting to see.

NOTE: This method preserves the artifact for 14 days and does not actually upload the file into your Bitbucket source directory, it is simply to preserve artifacts in between builds.

Hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)

Suggest an answer

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

Atlassian Community Events