We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我宿主机安装了go,安装路径: /usr/local/go
在docker-compose.yml配置了对应的映射
volumes: - /opt/walle_home/plugins/:/opt/walle_home/plugins/ - /opt/walle_home/codebase/:/opt/walle_home/codebase/ - /opt/walle_home/logs/:/opt/walle_home/logs/ - /root/.ssh:/root/.ssh/ - /usr/bin/go:/usr/bin/go - /root/.cache/go-build:/root/.cache/go-build - /root/go:/root/go - /root/gocode:/root/gocode - /usr/lib/golang:/usr/lib/golang - /usr/lib/golang/pkg/tool/linux_amd64:/usr/lib/golang/pkg/tool/linux_amd64 - /www/go:/www/go - /usr/local/go:/usr/local/go
当我用docker exec -i -t 356f96c5d45c /bin/bash命令进入docker中时,执行go build 是成功的,但是在walle部署时报如下错误
build cache is required, but could not be located: GOCACHE is not defined and neither $XDG_CACHE_HOME nor $HOME are defined
我怀疑是环境变量的问题,于是在walle 的项目配置-Deploy后置任务中,添加 go env ,结果报错:
missing $GOPATH
我想咨询一下,当我用/bin/bash命令进入docker 和 使用walle 直接部署时,环境变量会有什么不同吗? 或者有什么方法在我的docker里安装go环境吗?
The text was updated successfully, but these errors were encountered:
以ubuntu运行walle为例,在项目设置的自定义全局变量里加上:
自定义全局变量
HOME=/home/ubuntu GOPATH=/home/ubuntu/.go/
不管是直接安装还是docker安装,瓦力都是本地执行命名的,有编译环境要求的,比如go相关配置,需要进行相关的配置,以及如果是php,且执行composer,也需要满足composer.json的要求,其实这样不好。
Sorry, something went wrong.
walle 使用了第三方库fabric2来执行本地和远程命令,这个库在执行命令的时候会新开一个shell,在这个shell中默认会清空所有环境变量,官方文档说这样做是为了安全起见。
比较方便的解决办法是改源码: walle/service/waller.py:43 加一个参数:replace_env=False,这样会使fabric2在执行本地命令时不清空环境变量 result = super(Waller, self).local(command, pty=pty,replace_env=False, warn=True, watchers=[say_yes()], env=self.custom_global_env, **kwargs)
replace_env=False
result = super(Waller, self).local(command, pty=pty,replace_env=False, warn=True, watchers=[say_yes()], env=self.custom_global_env, **kwargs)
henyihanwobushi
meolu
aSmallPing
ZouHongxue
No branches or pull requests
我宿主机安装了go,安装路径: /usr/local/go
在docker-compose.yml配置了对应的映射
当我用docker exec -i -t 356f96c5d45c /bin/bash命令进入docker中时,执行go build 是成功的,但是在walle部署时报如下错误
build cache is required, but could not be located: GOCACHE is not defined and neither $XDG_CACHE_HOME nor $HOME are defined
我怀疑是环境变量的问题,于是在walle 的项目配置-Deploy后置任务中,添加 go env ,结果报错:
missing $GOPATH
我想咨询一下,当我用/bin/bash命令进入docker 和 使用walle 直接部署时,环境变量会有什么不同吗?
或者有什么方法在我的docker里安装go环境吗?
The text was updated successfully, but these errors were encountered: