Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

How to add go binary as bitbucket pipeline artifact? Edited

Hello, I am trying to add the output binary of my pipeline to the build-in artifactory.


image: golang:1.13

- step:
- mkdir -pv "${PACKAGE_PATH}"
- tar -cO --exclude-vcs --exclude=bitbucket-pipelines.yml . | tar -xv -C "${PACKAGE_PATH}"
- cd "${PACKAGE_PATH}"
- go get -v
- env GOOS=windows GOARCH=amd64 go build
- go build -v
- ls
- fx_update.exe

However, the binary does not end up in the artifactory:


So I threw this `ls` command in there to see if the .exe is present and Indeed it is:


Does anyone know why it's not doing what I want?


1 answer

1 accepted

1 vote
Answer accepted

Artifacts are given relative to the pipelines "build" directory (environment parameter: BITBUCKET_CLONE_DIR) by a relative path (compare with the docs for more details).

In your specific example it is perhaps most easy to copy the artifact over into that directory:

- cp -v -- fx_update.exe "${BITBUCKET_CLONE_DIR}"

Then it should already work as the file fx_update.exe should then be found for the artifact.

In a further thought you can consider to create a directory in your repository intended to have build artifacts stored into, I normally use build for it in the projects root directory and ignore files and directories in there as they are generated (build) so it's easy to run build scripts as well in the development environment on local machines and it's compatible with builds in a pipeline.

E.g. by creating the file build/go/.gitignore in the repository:

# go build artifacts directory

If you consider to do so, you need to adopt the artifacts setting (and the destination path of the cp command):

- cp -v -- "fx_update.exe" "${BITBUCKET_CLONE_DIR}/build/go"
- build/go/fx_update.exe

At the end of the day this is independent to the programming language, what makes go different here is that it has the go-path and/or the build-path.

However IIRC this changed some time ago and you can also run go builds and output to other locations, but I must admit I don't have an example or some more reference at hand right now.

Thank you. I was trying with the full path to the go src directory but this didn't work either. You can specify the output path with -o, as far as I know.

Have you tried coping the binary over to the bitbucket pipelines clone directory? Otherwise artifacts can not work.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Marketplace Apps & Integrations

Staying organized with Jira: best practices for a better project management

Project managers know this problem: A “mountain of work” lays in front of you, and you don’t know how and where to tackle them. Different to-dos lie ahead, but just one task after the other can be ha...

242 views 2 1
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