doushi3803
doushi3803
2017-02-13 16:41

将cmd文件夹中的golang应用程序部署到AWS Beanstalk

  • it技术
  • 互联网问答
  • IT行业问题
  • 编程语言问答
  • 计算机技术

I have a pre-existing golang project with the a following folder structure (minimized the folder for readability).

- postgre
    - service.go
- cmd
    - vano
        - main.go
    - vanoctl
        - main.go
vano.go

Now since my project web server is in ./cmd/vano I need to create a custom Buildfile and Procfile. So I did that

Here is my Buildfile

make: ./build.sh

build.sh file:

#!/usr/bin/env bash

# Install dependencies.
go get ./...
# Build app
go build ./cmd/vano -o bin/application

and finally my Procfile:

web: bin/application

So now my folder structure looks like this:

- postgre
    - service.go
- cmd
    - vano
        - main.go
    - vanoctl
        - main.go
vano.go
Buildfile
build.sh
Procfile

I zip up the source using git:

git archive --format=zip HEAD > vano.zip

And upload it to AWS Beanstalk. How ever I keep getting errors and AWS errors don't seem to be the most read. Here is my error

Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].

Error Message

[Instance: i-0d8f642474e3b2c68] Command failed on instance. Return code: 1 Output: (TRUNCATED)...' Failed to execute 'HOME=/tmp /opt/elasticbeanstalk/lib/ruby/bin/ruby /opt/elasticbeanstalk/lib/ruby/bin/foreman start --procfile /tmp/d20170213-1941-1baz0rh/eb-buildtask-0 --root /var/app/staging --env /var/elasticbeanstalk/staging/elasticbeanstalk.env'. Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/01_configure_application.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

Extra Error info:

Failed to execute 'HOME=/tmp /opt/elasticbeanstalk/lib/ruby/bin/ruby /opt/elasticbeanstalk/lib/ruby/bin/foreman start --procfile /tmp/d20170213-1941-1baz0rh/eb-buildtask-0 --root /var/app/staging --env /var/elasticbeanstalk/staging/elasticbeanstalk.env'
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐