Bash CIRCLECI echo to file给出权限错误

Bash CIRCLECI echo to file给出权限错误,bash,continuous-integration,travis-ci,continuous-deployment,circleci,Bash,Continuous Integration,Travis Ci,Continuous Deployment,Circleci,我试图将变量$NAME的内容写入一个名为 $VERSION\u文件 但是在做 echo $NAME > "$VERSION_FILE" 在当地工作,在circleci我得到: cannot create /version: Permission denied 随后的命令也会失败 head: cannot open '/version' for reading: No such file or directory 如果您没有使用root用户(从您的示例中我看不出来),那么在命令前面加上

我试图将变量$NAME的内容写入一个名为 $VERSION\u文件

但是在做

echo $NAME > "$VERSION_FILE"
在当地工作,在circleci我得到:

cannot create /version: Permission denied
随后的命令也会失败

head: cannot open '/version' for reading: No such file or directory

如果您没有使用root用户(从您的示例中我看不出来),那么在命令前面加上
sudo

前缀,您说它在命令行上工作,但不是在守护进程中工作?SELinux有问题吗?circleci是否以
根用户身份运行
/version
将位于
/
目录中,通常只有root用户才能在其中操作。