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

Problem with reaching artifact

Uros Cvijan July 3, 2019

So i will just give a brief overview of the pipeline file, as somehow in following step, artifact can be found:

 

image: maven:3-jdk-8-slim
  definitions:

- step: &dockerize

   name: Build

   steps:

   - some steps

   - mvn clean package 

   - cd target/azure-functions/name-of-function && zip -r $BITBUCKET_CLONE_DIR/name-of-function.zip .

artifacts:

- $BITBUCKET_CLONE_DIR/name-of-function.zip

 

- step: &deploy_zip

  name: Deploy zip to function

  script:

   - pipe: microsoft/azure-functions-deploy:1.0.1

      variables:

        AZURE_APP_ID: $SERVICE_PRINCIPAL_ID

        AZURE_PASSWORD: $SERVICE_PRINCIPAL_PASSWORD

       AZURE_TENANT_ID: $TENANT_ID

        ZIP_FILE: '$BITBUCKET_CLONE_DIR/name-of-function.zip'

        FUNCTION_APP_NAME: 'name-of-function'

        DEBUG: 'true'

pipelines:

  default:

     - step: *dockerize

     - step: *deploy_zip

 

So in second step i get error:

FileNotFoundError: [Errno 2] No such file or directory: '/opt/atlassian/pipelines/agent/build/name-of-function.zip'

What am i missing here? So i am doing mvn package of the azure function, and want to zip the content of my function so i can use pipe to deploy them to my function app.

Its strange that even in the artifact section of my build, there is nothing, empty screen.

Regards,

1 answer

1 accepted

0 votes
Answer accepted
Uros Cvijan July 3, 2019

I think i found it. As path for artifact is relative to the bitbucket_clone_dir, when i only put

artifacts:

- name-of-function.zip

 

and then later:

 

ZIP_FILE: 'name-of-function.zip'

 

It worked. I can see artifact in artifacts section of the build as well.

Simon Azzopardi
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!
December 17, 2019

Hi Uros,

and what is the value of the bitbucket_clone_dir ?

Uros Cvijan December 18, 2019

Hi Simon,

 

From the docs it says:

 

BITBUCKET_CLONE_DIR

The absolute path of the directory that the repository is cloned into within the Docker container.

 

You can run a test with some script and just have the:

- echo $BITBUCKET_CLONE_DIR

I think the path is:

/opt/atlassian/pipelines/agent/build

But you can check using the echo command.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events