【发布时间】:2019-10-01 01:29:10
【问题描述】:
我正在尝试使用 GitLab CI/CD 将 Angular 应用程序部署到 Firebase。
我的.gitlab-ci.yml 看起来像这样
stages:
- build
- test
- deploy
build:
stage: build
script:
- ng build --prod --aot
test:
stage: test
script:
- echo Running tests...
deploy:
stage: deploy
script:
- call npm install -g firebase-tools
- firebase deploy --token $FIREBASE_TOKEN
我在我的本地 PC 上使用 gitlab-runner,即使我已经安装了我需要的所有东西,并且我可以在本地毫无问题地运行这些脚本,但我不能用 GitLab CI/CD 做同样的事情。
说到部署阶段,我一直在努力
$ firebase deploy --token $FIREBASE_TOKEN
'firebase' 无法识别 作为内部或外部命令、可运行程序或批处理文件。
【问题讨论】:
-
您使用的是哪个执行器?在您的
deploy阶段,您没有使用带有所需工具的 Docker 映像。使用现有的或构建自己的。 -
我正在使用跑步者,我用
shellexecutor 配置了localy。我确信如果脚本在我的本地机器上运行良好,它也可以像gitlab-runner一样正常运行,但我想我错了? -
在这种情况下,它可能与 PATH 相关。确保 PATH 具有正确的值。
标签: angular firebase continuous-integration gitlab continuous-deployment