我正在使用此bitbucket-pipelines.yml
文件来测试我的应用程序,然后将其部署到服务器上。安装依赖项后,我们缺少nl_NL语言环境。我们使用以下文件:
到位桶,pipelines.yml:
image: php:7.2.6
pipelines:
default:
- step:
name: PHPUnit
caches:
- composer
script:
- apt-get update && apt-get install -y unzip git zlib1g-dev libicu-dev g++ locales
- locale-gen && locale-gen nl_NL
- echo "nl_NL UTF-8" >> /etc/locale.gen && echo "en_EN UTF-8" >> /etc/locale.gen && echo "enUS UTF-8" >> /etc/locale.gen && echo "en_GB UTF-8" >> /etc/locale.gen
- locale -a
安装后的语言环境-a输出如下:
locale -a
<1s
+ locale -a
C
C.UTF-8
POSIX
我确实在这个命令中期望nl_NL语言环境。这将导致测试失败。我该如何解决这个错误?
您需要更改命令的顺序。首先,将nl_NL UTF-8
(以及您需要的任何其他内容)添加到/etc/locale.gen
,然后才运行locale-gen
。