GitLab CI/CD乱码问题报错解决方法 - - my-test
GitLab CI/CD 乱码问题通常是指在使用 GitLab CI/CD 构建和部署应用程序时,由于编码问题导致的错误。为了解决这个问题,可以尝试以下方法:
utf-8
git config --global core.autocrlf input
如果发现字符编码不正确,可以修改为正确的编码,例如:
git config --global core.autocrlf input
git config --global core.eol lf
.gitlab-ci.yml
stages:
- build
- test
- deploy
build_job:
stage: build
script:
- echo '你好,世界!' > /tmp/hello.txt
tags:
- my-build
test_job:
stage: test
script:
- echo '你好,世界!' > /tmp/hello.txt
tags:
- my-test
deploy_job:
stage: deploy
script:
- echo '你好,世界!' > /tmp/hello.txt
tags:
- my-deploy
--locale
stages:
- build
- test
- deploy
build_job:
stage: build
script:
- echo '你好,世界!' > /tmp/hello.txt
tags:
- my-build
test_job:
stage: test
script: 拼多多帮助力入口
- echo '你好,世界!' > /tmp/hello.txt
tags:
- my-test
deploy_job:
stage: deploy
script:
- echo '你好,世界!' > /tmp/hello.txt
tags:
- my-deploy
environment:
I18N_LANGUAGE: en_US.UTF-8
这样,在执行构建、测试和部署任务时,GitLab CI/CD 将使用正确的字符编码。