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

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

Bitbucket pipelines for goland

Hi,

 

We are trying to build a pipelines for goLand.

For simple project is wok fine (with only main.go).

 

Our project have multi local packages:

myproject/
├── main.go
├── DB/
   └── DB1.go



we can't run the pipeline in bitbucket, we got an error:

main.go:4:2: cannot find package "aviramdevops/src/DB" in any of: /usr/local/go/src/aviramdevops/src/DB (from $GOROOT)
/go/src/aviramdevops/src/DB (from $GOPATH)


In localhost the command "go build" is successfully.
We got the error only in bitbucket pipeline.

Can you help me with that how to solved that case?

Thank you,
Aviram

main file:
==========
package main
import
(
"DB"
)
func main() {
DB.OpenConnection()
}
==========


bitbucket-pipelines.yml:
==========
image: golang:1.12
pipelines:
branches:
master:
- step:
script:
- source bitbucket-pipelines-go.sh
- cd ${IMPORT_PATH}
- go get
- go build
- go test
==========

 

 

1 answer

0 votes

Hello @aviram1202,

Welcome to the Community.

I'm not an expert in Go so can't tell much about the error apart from some package is not found.

Pipelines is actually running your script commands inside of a Docker container created from an image you specified. So there's nothing specific to Pipelines that fails your build, the problem is with the build configuration.

I'd advise you to debug your pipeline locally – this is very similar to what happens in the Cloud when your pipeline is triggered. Here's a guide on how to do that.

Hope this helps. Let me know if you have any questions.

Cheers,
Daniil

Suggest an answer

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

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,787 views 0 7
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