It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Is $BITBUCKET_PIPE_SHARED_STORAGE_DIR available in the top-level pipeline?

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

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.

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.

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.

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?

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!

Thanks! I will check it out soon.

Like Daniel Santos likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,038 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you