Gitlab ci文件对我的项目没有影响
我正在尝试将angular应用程序自动构建/部署到远程服务器,但我不明白为什么Gitlab ci文件对我的项目没有影响,gitlab,gitlab-ci,Gitlab,Gitlab Ci,我正在尝试将angular应用程序自动构建/部署到远程服务器,但我不明白为什么gitlab ci.yml不起作用: image: trion/ng-cli-karma cache: paths: - node_modules/ before_script: - apt-get update -qq && apt-get install -y -qq sshpass deploy_stage: stage: deploy environment: St
gitlab ci.yml
不起作用:
image: trion/ng-cli-karma
cache:
paths:
- node_modules/
before_script:
- apt-get update -qq && apt-get install -y -qq sshpass
deploy_stage:
stage: deploy
environment: Staging
only:
- master
script:
- rm ./package-lock.json
- npm install
- ./node_modules/@angular/cli/bin/ng test --progress false --single-run=true --watch=false
- ./node_modules/@angular/cli/bin/ng e2e --progress false --watch=false
- ./node_modules/@angular/cli/bin/ng build --progress false --prod
- cd dist/
- ls
- sshpass -V
- export SSHPASS=$USER_PASS
- sshpass -e scp -o stricthostkeychecking=no -r . myusername@myserver:/var/www/html
deploy_production:
stage: deploy
environment: Production
only:
- tags
script:
- rm ./package-lock.json
- npm install
- ./node_modules/@angular/cli/bin/ng test --progress false --single-run=true --watch=false
- ./node_modules/@angular/cli/bin/ng e2e --progress false --watch=false
- ./node_modules/@angular/cli/bin/ng build --progress false --prod
- cd dist/
- ls
- sshpass -V
- export SSHPASS=$USER_PASS
- sshpass -e scp -o stricthostkeychecking=no -r . myusername@myserver-prd:/var/www/html
在我的Gitlab CE服务器上,我看不到文件的效果,没有生成作业:
我在这里遗漏了一步吗?您在问题中提到的
gitlab ci.yml
文件应该重命名为.gitlab ci.yml
.您能制作一个非常简单的.gitlab-ci.yml文件,看看是否有效吗?只有一个作业,包括
阶段:build
和脚本:echo test
,或者类似的东西。然后,您可以从那里开始工作,并查看脚本在哪里停止工作。可能是您在一个分支上完成了这个新的.gitlab-ci.yml文件,但您只使用了主文件,因此在合并它之前它不会运行。另一个作业仅在标记上运行,因为only:tags
。忽略我之前在GitLab中写的关于stage
<代码>生成
,测试
,部署
是默认的。@Rekovni确实是命名问题。谢谢你的帮助。请回答这个问题,这样我就可以把它标为答案了。