gitlab-ci - gitlab-ci 测试构建失败
问题描述
我是 gitlab-ci 的新手,我正在尝试测试我的构建阶段,但在最后一步之前它一直失败。这是部分
build:
stage: build
before_script:
- git config user.name "$GITLAB_USER_NAME"
- git config user.email "$GITLAB_USER_EMAIL"
script:
- git add .
- git commit -m "[skip ci] migrations"
- git push "https://${GITLAB_USER_NAME}:${CI_GIT_TOKEN}@${CI_REPOSITORY_URL}" "HEAD:qa" -o ci.skip
dependencies:
- migrations
only:
- qa
这是日志,最后几行
Using docker image sha256:5b3b4504ff1f7b859dbc5d7fb86f4afc644be62f99b8ced636fbca64c8a6c2de for python:latest with digest python@sha256:73cc381fa0fe5e6d5dd38f1397da28c70096519d8818c2249f2bc8e1158ba015 ...
$ git config user.name "$GITLAB_USER_NAME"
$ git config user.email "$GITLAB_USER_EMAIL"
$ git add .
$ git commit -m "[skip ci] migrations"
HEAD detached at bf2a8e4
nothing to commit, working tree clean
Cleaning up file based variables
00:01
ERROR: Job failed: exit code 1
我怎样才能知道ERROR: Job failed: exit code 1
是什么?我正在使用共享跑步者
解决方案
错误ERROR: Job failed: exit code 1
来自 git 没有找到任何要提交的内容。换句话说,以下消息导致错误:
nothing to commit, working tree clean
Cleaning up file based variables
您可以确定有什么要提交的,或者您可以按照此相关线程中的概述调整您的脚本:How to git commit nothing without an error?
推荐阅读
- asp.net - 如何将 ngOninit 与异步数据一起使用
- gtk - 同步调度到 GTK+ 的主线程
- python - Python line_num 打印行号仅输出最后一个行号
- alloy - Alloy :限制字符串字段的值
- c++ - Cmake 找不到 Boost(缺少 python)(找到版本 1.73.0)
- javascript - 无法获取动态生成的 id
- visual-studio - 在本地机器上运行解决方案的问题(VS 2017)
- excel - Excel:从工作簿获取数据未获取所有行
- python - 以可以并行化的方式在子张量上应用函数(Pytorch)
- android - 使用 Kotlin 的 Android Studio WebView“期望成员声明”