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

deploy Golang application to Heroku via pipelines

Deleted user April 10, 2019

Hi There,

 

I am trying to deploy my first Go application to Heroku, and I am using bitbucket pipelines. When I run deploy, I got an error. 

 

Here is error message cannot find module for path _/opt/atlassian/pipelines/agent/build/__PACKAGE_PATH_/connection

 

Here is my bitbucket-pipelines.yml file

image: golang:1.12.3clone: depth: fullpipelines:
default: - step: name: test deployment: production script: #start to deploy it #- echo "start to deploy" # - pipe: atlassian/heroku-deploy:0.1.1 # variables: # HEROKU_API_KEY: $HEROKU_API_KEY # HEROKU_APP_NAME: $HEROKU_APP_NAME - PACKAGE_PATH="\${GOPATH}/src/bitbucket.org/\${BITBUCKET_REPO_OWNER}/\${BITBUCKET_REPO_SLUG}" - mkdir -pv "\${PACKAGE_PATH}" - tar -cO --exclude-vcs --exclude=bitbucket-pipelines.yml . | tar -xv -C "\${PACKAGE_PATH}" - cd "\${PACKAGE_PATH}" - go get -v - go build -v - git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD

1 answer

0 votes
Tom Bradshaw
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 15, 2019

Hi @[deleted]

It looks like this is go error. I suspect that it is occurring because a specific file cannot be found. 

My first suggestion would be to try to debug this build locally using the instructions here https://confluence.atlassian.com/bitbucket/debug-your-pipelines-locally-with-docker-838273569.html. I would be specifically looking for the 'connection' file/folder and the interactions of the variables.

If this works correctly it might be a problem with the PACKAGE_PATH variable. Try echoing that to confirm that it is what you expect.

If none of that works can I ask you to paste your bitbucket-pipelines.yml file again in a code block with the formatting the file normally has and point out the specific step that is throwing the error.

Cheers,

Tom

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events