Is $BITBUCKET_PIPE_SHARED_STORAGE_DIR available in the top-level pipeline?

Mike Burton June 13, 2019

I wanted to copy my code to a shared location for use in my pipe steps, but it doesn't appear that $BITBUCKET_PIPE_SHARED_STORAGE_DIR is recognized. My copy step is defined as follows:

definitions:
steps:
- step: &copyCodeToSharedStorage
script:
- cp -r . $BITBUCKET_PIPE_SHARED_STORAGE_DIR

But seeing this in the log:

 

cp -r . $BITBUCKET_PIPE_SHARED_STORAGE_DIR
cp: missing destination file operand after ‘.’
Try 'cp --help' for more information.

1 answer

0 votes
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 14, 2019

Hi @Mike Burton

I want to help you with this one, but I'll need some more clues to understand where the variables BITBUCKET_PIPE_SHARED_STORAGE_DIR come from.

Did you declare that variable in repository variables?
If I do it here, I'm able to use it as expected.

Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 18, 2019

Thank you for sharing. I'll be in touch with the development team to check why this is happening. As soon I have something to share I'll be posting it here.

Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 19, 2019

Hello @Mike Burton,

I was able to get the information we needed from a Pipelines developer. According to him, we don’t actually expose that variable in the step of a pipeline. It’s only present in the pipe itself. Which means that someone writing a custom pipe can use it, but not outside of it.
If you are trying to use this information to pass data to another step you should use an artifact instead.

Please let us know your use case if the information provided is not enough to allow you moving forward on this.

Amit Edelshtein January 2, 2020

Hi,

I've been trying to figure out whether it's possible to use artifacts with custom Pipes, but couldn't find anything in the documentation. Say I want to use a custom Pipe to generate some file that I can later use in a normal Pipelines step. How would I do that?

Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 3, 2020

Hey @Amit Edelshtein

I'm sorry for the delay (my vacation time).
I  asked one of our developers about this and he shared an example where a file is created in a pipe and used in a different step later.

This is the one:
https://bitbucket.org/bitbucketpipelines/example-aws-lambda-deploy/src/master/bitbucket-pipelines.yml

I hope that helps!

Like Taylor Gregory likes this
Amit Edelshtein February 10, 2020

Thanks! I will check it out soon.

Like Daniel Santos likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events