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==========
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
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.