gitlab的容器注册表(https://gitlab.com/help/container_registry/README.md)的文档提供了一个配置示例,其中包含以下指令:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.example.com
而这个解释:
You have to use the credentials of the special gitlab-ci-token user with its password stored in $CI_BUILD_TOKEN in order to push to the Registry connected to your project. This allows you to automated building and deployment of your Docker images.
我找不到关于这个特殊gitlab-ci-token用户的任何文档,也没有关于$CI_BUILD_TOKENvar的文档.
这个特殊用户是什么?它是自动可用的吗?是否必须在某处定义?应该给$CI_BUILD_TOKENvar 什么值?
我正在尝试根据存储在数据库中的当前用户的首选项设置区域设置.
因此,我们的User类有一个getPreferredLanguage,它返回一个语言环境标识('en','fr_FR'等).
我考虑过以下方法:
不幸的是,这不起作用.当调用"locale"侦听器服务的onRequestEvent方法时,安全上下文没有令牌.看起来上下文监听器是在一个非常晚的阶段(优先级为0)调用的,并且不可能告诉我的"locale"监听器在安全上下文之前运行.
有谁知道如何修复这种方法,或建议另一种方法?