相关疑难解决方法(0)

Github 主分支和主分支的区别?

我在 master 分支上尝试了 git push ,但它只是显示我有新的拉取请求,但是当我单击新的拉取请求时,它会比较更改但没有显示任何将这些更改添加到存储库的选项。它只显示我所做的更改。

在此处输入图片说明

在此处输入图片说明

但是当我输入命令时

git push origin main
Run Code Online (Sandbox Code Playgroud)

添加到我的存储库的所有文件。

但是当我这样做的时候

git push origin master
Run Code Online (Sandbox Code Playgroud)

它不起作用。为什么?我听说他们正在用 main 替换 master。那么,他们将来会移除主人吗?

git github

85
推荐指数
4
解决办法
5万
查看次数

向 GitLab CI yaml 添加需要关系但出现错误:作业未添加到管道中

我正在尝试在 Gitlab CI yaml 配置文件中的作业之间添加需求。


stages:
  - build
  - test
  - package
  - deploy

maven-build:
  stage: build
  only:
    - merge_requests
    - master
    - branches
  ...
test:
  stage: test
  needs: [ "maven-build" ]
  only:
    - merge_requests
    - master
  ...
docker-build:
  stage: package
  needs: [ "test" ]
  only:
    - master
  ...
deploy-stage:
  stage: deploy
  needs: [ "docker-build" ]
  only:
    - master
  ...
deploy-prod:
  stage: deploy
  needs: [ "docker-build" ]
  only:
    - master
  when: manual
  ...

Run Code Online (Sandbox Code Playgroud)

我已经使用 GitLab CI 在线 lint 工具来检查我的语法,它是正确的 …

gitlab gitlab-ci

10
推荐指数
2
解决办法
1321
查看次数

当依赖于以前的手动作业时,GitLab-CI 作业失败

情况

考虑以下.gitlab-ci.yml示例:

build:
    stage: build
    script: echo "Building..."

build-doc:
    stage: build
    when: manual
    script: 
        - echo "Building doc..."
        - echo "build result" > output.txt
    artifacts:
        name: "%CI_BUILD_NAME%_%CI_BUILD_ID%"
        expire_in: 1 week
        paths:
            - "output.txt"

deploy-doc:
    stage: deploy
    only:
        - master
    dependencies:
        - build-doc
    script: 
        - echo "Deploying doc..."
        - type output.txt
Run Code Online (Sandbox Code Playgroud)

结果

这个管道在master分支上的结果是:

gitlab-ci-result

deploy-doc作业日志说:

$ echo "Deploying doc..."
"Deploying doc..."
$ type output.txt
The system cannot find the file specified.
ERROR: Build failed: exit status 1 …
Run Code Online (Sandbox Code Playgroud)

continuous-integration gitlab gitlab-ci

6
推荐指数
1
解决办法
3036
查看次数

标签 统计

gitlab ×2

gitlab-ci ×2

continuous-integration ×1

git ×1

github ×1