continuous-integration - GITLAB CI 管道未触发
问题描述
我已经为 GitLab CI/CD 编写了这个 yml 文件。有一个已配置并正在运行的共享运行器。我是第一次这样做,不知道哪里出错了。我在 repo 上的 angular js 项目有一个 gulp 构建文件,可以在本地机器上完美运行。这段代码只需要在我的跑步者所在的虚拟机上触发它。提交时,管道不显示任何作业。让我知道需要纠正的地方!
image: docker:latest
cache:
paths:
- node_modules/
deploy_stage:
stage: build
only:
- master
environment: stage
script:
- rmdir -rf "build"
- mkdir "build"
- cd "build"
- git init
- git clone "my url"
- cd "path of cloned repository"
- gulp build
解决方案
你要投身哪个分支?master
您的管道配置为仅在分支上提交时运行。
...
only:
- master
...
如果您还想为其他分支触发作业,请从.gitlab-ci.yml
文件中删除此限制。
不要忘记Enable shared Runners
(默认情况下它们可能未启用),可以在 GitLab 项目页面下的Settings -> CI/CD -> Runners
.
更新:您的管道触发器是否曾经为您的项目工作过?
如果没有,那么我会尝试配置简单的管道来测试触发器是否正常工作:
test_simple_job:
script:
- echo I should execute for any pipeline trigger.
推荐阅读
- java - 如何将文本文件中的不同数据类型添加到数组列表中?
- qt - 如何提高图形质量
- apache-spark - 如何使用 Hive 仓库连接器在 pyspark 中执行 HQL 文件
- python - Django 精神在创建主题时生成无法在 settings.CACHES 中找到“%s”的配置错误”
- asp.net-core - OnGet 中的异步不会等待函数结束,而是会转到剃刀文件?
- vb.net - 无法在客户端计算机中部署 Crystal Report Viewe 表单
- docker - Windows docker 默认编码
- angular - 从 UIWebView 迁移到 Cordova 应用程序的 WKWebView 时出错
- c# - 如何在 .NET Core 3.0 应用程序中更新单个用户身份验证令牌?
- angular - 在 ng Bootstrap datepicker 中禁用特定日期