gitlab CI变量返回空字符串? [英] Gitlab CI variables returns empty string?
问题描述
距我的项目之一在Gitlab CI上开始构建失败已经有2天了.主要错误是 E_MISSING_APP_KEY
,当我通过从我的 .gitlab-ci中回显
配置,就像这样 $ HOST
和 $ PORT
来检查另一个变量时.yml
测试:脚本:-回声"$ {HOST} $ {PORT}"-节点-e"console.log(process.env.HOST,process.env.PORT)"-node_modules/.bin/nyc节点ace测试-t 0
我什么都没有.
构建失败,因为它无法读取我在其CI设置中设置的环境变量.
有人遇到相同的问题吗?&该如何解决?
更新:
我正在尝试创建仅包含 .gitlab-ci.yml
文件
但是为什么在我的
该问题通过删除所有我拥有的&变量来解决.从"CI设置"中重新设置它们.并且构建管道正在运行,没有任何错误.(除非实际测试仍然失败,大声笑)
老实说,我仍然想知道为什么会发生这种情况?希望这里没有人会遇到像我一样的问题.
It's been 2 days since one of my project' build starts failing on Gitlab CI. The main error was E_MISSING_APP_KEY
and when I check another variable just by echoing $HOST
and $PORT
from my .gitlab-ci.yml
config, like this
tests:
script:
- echo "${HOST} ${PORT}"
- node -e "console.log(process.env.HOST, process.env.PORT)"
- node_modules/.bin/nyc node ace test -t 0
I got nothing.
The build was failed because it can't read my environment variable that I set on its CI Settings.
Anyone experiencing same issue? & how to solve this?
Update:
I'm trying to create new project with only containing .gitlab-ci.yml
file here and it's seems working just fine
But why the world it's still failing on my main project?
The issue is solved by delete all of my variables I've had & set them back from the CI Setting. And the build pipeline is running without any errors. (except the actual testing is still failed, lol)
Honestly, I'm still wondering why this could happened? and hopefully no one will experiencing same kind of issue like me here..
这篇关于gitlab CI变量返回空字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!