1

您好我想在 AWS ElasticBeanstalk php 7.0 环境中使用 goofys。
我创建 .ebextentions/00_install_goofy.config。

(从二进制安装 golang,因为 yum 的 golang 版本很旧。

packages:
  yum:
    fuse: []
commands:
  100_install_golang_01: 
    command: wget https\://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz
  100_install_golang_02: 
    command: tar -C /usr/local -xzf go1.9.linux-amd64.tar.gz
  100_install_golang_03: 
    command: export GOROOT=/usr/local/go
    test: [ -z "$GOROOT" ]
  100_install_golang_04: 
    command: export GOPATH=/home/ec2-user/go
    test: [ -z "$GOPATH" ]
  100_install_golang_05: 
    command: export PATH=$PATH\:$GOROOT/bin\:$GOPATH/bin
  100_install_golang_06: 
    command: echo $GOPATH > gopath 

但是 100_install_golang_03 不能很好地工作......

Test for Command 100_install_golang_03
[2017-09-09T14:39:52.422Z] INFO  [3034]  - [Application deployment app-f68c-170909_143641@1/StartupStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_1_yubion_website] : Completed activity.
[2017-09-09T14:39:52.422Z] INFO  [3034]  - [Application deployment app-f68c-170909_143641@1/StartupStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild] : Activity execution failed, because: [Errno 2] No such file or directory (ElasticBeanstalk::ExternalInvocationError)

我无法导出环境和路径。我可以在 .ebextensions 上设置 PATH 吗?

或者有没有更好的方法在 ElasticBeanstalk 上自动安装 goofys。

4

1 回答 1

1

最后我发现 .ebextensions 定义的命令运行 NO EVIRONMET VALUE。它适用于沙盒等环境。

所以“导出”命令的范围只是“命令”部分。

如果要在命令中使用 PATH,则必须将导出命令添加到每个命令中。

此外,如果您想在部署 eb 后使用 PATH,请参阅以下链接。

如何在 Elastic Beanstalk 上添加 PATH

于 2017-09-26T10:36:29.527 回答